<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE BangPatterns #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE DataKinds #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE GADTs #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses  #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Copyright (c) 2010, Jo&#227;o Dias, Simon Marlow, Simon Peyton Jones,</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- and Norman Ramsey</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Modifications copyright (c) The University of Glasgow 2012</span><span>
</span><span id="line-14"></span><span class="hs-comment">--</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- This module is a specialised and optimised version of</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- Compiler.Hoopl.Dataflow in the hoopl package.  In particular it is</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- specialised to the UniqSM monad.</span><span>
</span><span id="line-18"></span><span class="hs-comment">--</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Cmm.Dataflow</span><span>
</span><span id="line-21"></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier">C</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier">O</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier">Block</span></a></span><span>
</span><span id="line-22"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#lastNode"><span class="hs-identifier">lastNode</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier">entryLabel</span></a></span><span>
</span><span id="line-23"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#foldNodesBwdOO"><span class="hs-identifier">foldNodesBwdOO</span></a></span><span>
</span><span id="line-24"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#foldRewriteNodesBwdOO"><span class="hs-identifier">foldRewriteNodesBwdOO</span></a></span><span>
</span><span id="line-25"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier">DataflowLattice</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#OldFact"><span class="hs-identifier">OldFact</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#NewFact"><span class="hs-identifier">NewFact</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#JoinedFact"><span class="hs-identifier">JoinedFact</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-26"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#TransferFun"><span class="hs-identifier">TransferFun</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#RewriteFun"><span class="hs-identifier">RewriteFun</span></a></span><span>
</span><span id="line-27"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#Fact"><span class="hs-identifier">Fact</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier">FactBase</span></a></span><span>
</span><span id="line-28"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#getFact"><span class="hs-identifier">getFact</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#mkFactBase"><span class="hs-identifier">mkFactBase</span></a></span><span>
</span><span id="line-29"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#analyzeCmmFwd"><span class="hs-identifier">analyzeCmmFwd</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#analyzeCmmBwd"><span class="hs-identifier">analyzeCmmBwd</span></a></span><span>
</span><span id="line-30"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#rewriteCmmBwd"><span class="hs-identifier">rewriteCmmBwd</span></a></span><span>
</span><span id="line-31"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#changedIf"><span class="hs-identifier">changedIf</span></a></span><span>
</span><span id="line-32"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#joinOutFacts"><span class="hs-identifier">joinOutFacts</span></a></span><span>
</span><span id="line-33"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#joinFacts"><span class="hs-identifier">joinFacts</span></a></span><span>
</span><span id="line-34"></span><span>  </span><span class="hs-special">)</span><span>
</span><span id="line-35"></span><span class="hs-keyword">where</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.html"><span class="hs-identifier">GHC.Cmm</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../array/src/Data.Array.html#"><span class="hs-identifier">Data.Array</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#"><span class="hs-identifier">Data.Maybe</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntSet.html#"><span class="hs-identifier">Data.IntSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.IntSet.Internal.html#IntSet"><span class="hs-identifier">IntSet</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntSet.html#"><span class="hs-identifier">Data.IntSet</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">IntSet</span></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Kind.html#"><span class="hs-identifier">Data.Kind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier">Type</span></span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Block</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Graph.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Graph</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Collections.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Collections</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Label</span></a></span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span class="hs-keyword">type</span><span> </span><span class="hs-keyword">family</span><span>   </span><span id="Fact"><span class="annot"><a href="GHC.Cmm.Dataflow.html#Fact"><span class="hs-identifier hs-var">Fact</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681045580"><span class="annot"><a href="#local-6989586621681045580"><span class="hs-identifier hs-type">x</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Extensibility"><span class="hs-identifier hs-type">Extensibility</span></a></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681045579"><span class="annot"><a href="#local-6989586621681045579"><span class="hs-identifier hs-type">f</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Type</span></span><span>
</span><span id="line-54"></span><span class="hs-keyword">type</span><span> </span><span class="hs-keyword">instance</span><span> </span><span id="Fact"><span class="annot"><a href="GHC.Cmm.Dataflow.html#Fact"><span class="hs-identifier hs-var">Fact</span></a></span></span><span> </span><span id="local-6989586621681045578"><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045578"><span class="hs-identifier hs-type">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045578"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">type</span><span> </span><span class="hs-keyword">instance</span><span> </span><span id="Fact"><span class="annot"><a href="GHC.Cmm.Dataflow.html#Fact"><span class="hs-identifier hs-var">Fact</span></a></span></span><span> </span><span id="local-6989586621681045577"><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045577"><span class="hs-identifier hs-type">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="#local-6989586621681045577"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="hs-keyword">newtype</span><span> </span><span id="OldFact"><span class="annot"><a href="GHC.Cmm.Dataflow.html#OldFact"><span class="hs-identifier hs-var">OldFact</span></a></span></span><span> </span><span id="local-6989586621681045644"><span class="annot"><a href="#local-6989586621681045644"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="OldFact"><span class="annot"><a href="GHC.Cmm.Dataflow.html#OldFact"><span class="hs-identifier hs-var">OldFact</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621681045644"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="hs-keyword">newtype</span><span> </span><span id="NewFact"><span class="annot"><a href="GHC.Cmm.Dataflow.html#NewFact"><span class="hs-identifier hs-var">NewFact</span></a></span></span><span> </span><span id="local-6989586621681045642"><span class="annot"><a href="#local-6989586621681045642"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="NewFact"><span class="annot"><a href="GHC.Cmm.Dataflow.html#NewFact"><span class="hs-identifier hs-var">NewFact</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621681045642"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="hs-comment">-- | The result of joining OldFact and NewFact.</span><span>
</span><span id="line-62"></span><span class="hs-keyword">data</span><span> </span><span id="JoinedFact"><span class="annot"><a href="GHC.Cmm.Dataflow.html#JoinedFact"><span class="hs-identifier hs-var">JoinedFact</span></a></span></span><span> </span><span id="local-6989586621681045723"><span class="annot"><a href="#local-6989586621681045723"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-63"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="Changed"><span class="annot"><a href="GHC.Cmm.Dataflow.html#Changed"><span class="hs-identifier hs-var">Changed</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="#local-6989586621681045723"><span class="hs-identifier hs-type">a</span></a></span><span>     </span><span class="hs-comment">-- ^ Result is different than OldFact.</span><span>
</span><span id="line-64"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="NotChanged"><span class="annot"><a href="GHC.Cmm.Dataflow.html#NotChanged"><span class="hs-identifier hs-var">NotChanged</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="#local-6989586621681045723"><span class="hs-identifier hs-type">a</span></a></span><span>  </span><span class="hs-comment">-- ^ Result is the same as OldFact.</span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span id="local-6989586621681045728"><span class="annot"><a href="GHC.Cmm.Dataflow.html#getJoined"><span class="hs-identifier hs-type">getJoined</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#JoinedFact"><span class="hs-identifier hs-type">JoinedFact</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045728"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045728"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-67"></span><span id="getJoined"><span class="annot"><span class="annottext">getJoined :: forall a. JoinedFact a -&gt; a
</span><a href="GHC.Cmm.Dataflow.html#getJoined"><span class="hs-identifier hs-var hs-var">getJoined</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.html#Changed"><span class="hs-identifier hs-type">Changed</span></a></span><span> </span><span id="local-6989586621681045571"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681045571"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681045571"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-68"></span><span class="annot"><a href="GHC.Cmm.Dataflow.html#getJoined"><span class="hs-identifier hs-var">getJoined</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.html#NotChanged"><span class="hs-identifier hs-type">NotChanged</span></a></span><span> </span><span id="local-6989586621681045570"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681045570"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681045570"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span id="local-6989586621681045725"><span class="annot"><a href="GHC.Cmm.Dataflow.html#changedIf"><span class="hs-identifier hs-type">changedIf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045725"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#JoinedFact"><span class="hs-identifier hs-type">JoinedFact</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045725"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-71"></span><span id="changedIf"><span class="annot"><span class="annottext">changedIf :: forall a. Bool -&gt; a -&gt; JoinedFact a
</span><a href="GHC.Cmm.Dataflow.html#changedIf"><span class="hs-identifier hs-var hs-var">changedIf</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; JoinedFact a
forall a. a -&gt; JoinedFact a
</span><a href="GHC.Cmm.Dataflow.html#Changed"><span class="hs-identifier hs-var">Changed</span></a></span><span>
</span><span id="line-72"></span><span class="annot"><a href="GHC.Cmm.Dataflow.html#changedIf"><span class="hs-identifier hs-var">changedIf</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; JoinedFact a
forall a. a -&gt; JoinedFact a
</span><a href="GHC.Cmm.Dataflow.html#NotChanged"><span class="hs-identifier hs-var">NotChanged</span></a></span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="hs-keyword">type</span><span> </span><span id="JoinFun"><span class="annot"><a href="GHC.Cmm.Dataflow.html#JoinFun"><span class="hs-identifier hs-var">JoinFun</span></a></span></span><span> </span><span id="local-6989586621681045569"><span class="annot"><a href="#local-6989586621681045569"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#OldFact"><span class="hs-identifier hs-type">OldFact</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045569"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#NewFact"><span class="hs-identifier hs-type">NewFact</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045569"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#JoinedFact"><span class="hs-identifier hs-type">JoinedFact</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045569"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="hs-keyword">data</span><span> </span><span id="DataflowLattice"><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-var">DataflowLattice</span></a></span></span><span> </span><span id="local-6989586621681045722"><span class="annot"><a href="#local-6989586621681045722"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="DataflowLattice"><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-var">DataflowLattice</span></a></span></span><span>
</span><span id="line-77"></span><span>    </span><span class="hs-special">{</span><span> </span><span id="fact_bot"><span class="annot"><span class="annottext">forall a. DataflowLattice a -&gt; a
</span><a href="GHC.Cmm.Dataflow.html#fact_bot"><span class="hs-identifier hs-var hs-var">fact_bot</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621681045722"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-78"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="fact_join"><span class="annot"><span class="annottext">forall a. DataflowLattice a -&gt; JoinFun a
</span><a href="GHC.Cmm.Dataflow.html#fact_join"><span class="hs-identifier hs-var hs-var">fact_join</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#JoinFun"><span class="hs-identifier hs-type">JoinFun</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045722"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-79"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="hs-keyword">data</span><span> </span><span id="Direction"><span class="annot"><a href="GHC.Cmm.Dataflow.html#Direction"><span class="hs-identifier hs-var">Direction</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Fwd"><span class="annot"><a href="GHC.Cmm.Dataflow.html#Fwd"><span class="hs-identifier hs-var">Fwd</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="Bwd"><span class="annot"><a href="GHC.Cmm.Dataflow.html#Bwd"><span class="hs-identifier hs-var">Bwd</span></a></span></span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-keyword">type</span><span> </span><span id="TransferFun"><span class="annot"><a href="GHC.Cmm.Dataflow.html#TransferFun"><span class="hs-identifier hs-var">TransferFun</span></a></span></span><span> </span><span id="local-6989586621681045563"><span class="annot"><a href="#local-6989586621681045563"><span class="hs-identifier hs-type">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045563"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045563"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span class="hs-comment">-- | Function for rewrtiting and analysis combined. To be used with</span><span>
</span><span id="line-86"></span><span class="hs-comment">-- @rewriteCmm@.</span><span>
</span><span id="line-87"></span><span class="hs-comment">--</span><span>
</span><span id="line-88"></span><span class="hs-comment">-- Currently set to work with @UniqSM@ monad, but we could probably abstract</span><span>
</span><span id="line-89"></span><span class="hs-comment">-- that away (if we do that, we might want to specialize the fixpoint algorithms</span><span>
</span><span id="line-90"></span><span class="hs-comment">-- to the particular monads through SPECIALIZE).</span><span>
</span><span id="line-91"></span><span class="hs-keyword">type</span><span> </span><span id="RewriteFun"><span class="annot"><a href="GHC.Cmm.Dataflow.html#RewriteFun"><span class="hs-identifier hs-var">RewriteFun</span></a></span></span><span> </span><span id="local-6989586621681045562"><span class="annot"><a href="#local-6989586621681045562"><span class="hs-identifier hs-type">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045562"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045562"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span id="local-6989586621681045717"><span class="annot"><a href="GHC.Cmm.Dataflow.html#analyzeCmmBwd"><span class="hs-identifier hs-type">analyzeCmmBwd</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#analyzeCmmFwd"><span class="hs-identifier hs-type">analyzeCmmFwd</span></a></span><span>
</span><span id="line-94"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-type">DataflowLattice</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045717"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-95"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#TransferFun"><span class="hs-identifier hs-type">TransferFun</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045717"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-96"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-97"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045717"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-98"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045717"><span class="hs-identifier hs-type">f</span></a></span></span><span>
</span><span id="line-99"></span><span id="analyzeCmmBwd"><span class="annot"><span class="annottext">analyzeCmmBwd :: forall f.
DataflowLattice f
-&gt; TransferFun f -&gt; CmmGraph -&gt; FactBase f -&gt; FactBase f
</span><a href="GHC.Cmm.Dataflow.html#analyzeCmmBwd"><span class="hs-identifier hs-var hs-var">analyzeCmmBwd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Direction
-&gt; DataflowLattice f
-&gt; TransferFun f
-&gt; CmmGraph
-&gt; FactBase f
-&gt; FactBase f
forall f.
Direction
-&gt; DataflowLattice f
-&gt; TransferFun f
-&gt; CmmGraph
-&gt; FactBase f
-&gt; FactBase f
</span><a href="GHC.Cmm.Dataflow.html#analyzeCmm"><span class="hs-identifier hs-var">analyzeCmm</span></a></span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="GHC.Cmm.Dataflow.html#Bwd"><span class="hs-identifier hs-var">Bwd</span></a></span><span>
</span><span id="line-100"></span><span id="analyzeCmmFwd"><span class="annot"><span class="annottext">analyzeCmmFwd :: forall f.
DataflowLattice f
-&gt; TransferFun f -&gt; CmmGraph -&gt; FactBase f -&gt; FactBase f
</span><a href="GHC.Cmm.Dataflow.html#analyzeCmmFwd"><span class="hs-identifier hs-var hs-var">analyzeCmmFwd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Direction
-&gt; DataflowLattice f
-&gt; TransferFun f
-&gt; CmmGraph
-&gt; FactBase f
-&gt; FactBase f
forall f.
Direction
-&gt; DataflowLattice f
-&gt; TransferFun f
-&gt; CmmGraph
-&gt; FactBase f
-&gt; FactBase f
</span><a href="GHC.Cmm.Dataflow.html#analyzeCmm"><span class="hs-identifier hs-var">analyzeCmm</span></a></span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="GHC.Cmm.Dataflow.html#Fwd"><span class="hs-identifier hs-var">Fwd</span></a></span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span id="local-6989586621681045711"><span class="annot"><a href="GHC.Cmm.Dataflow.html#analyzeCmm"><span class="hs-identifier hs-type">analyzeCmm</span></a></span><span>
</span><span id="line-103"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#Direction"><span class="hs-identifier hs-type">Direction</span></a></span><span>
</span><span id="line-104"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-type">DataflowLattice</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045711"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-105"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#TransferFun"><span class="hs-identifier hs-type">TransferFun</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045711"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-106"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-107"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045711"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-108"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045711"><span class="hs-identifier hs-type">f</span></a></span></span><span>
</span><span id="line-109"></span><span id="analyzeCmm"><span class="annot"><span class="annottext">analyzeCmm :: forall f.
Direction
-&gt; DataflowLattice f
-&gt; TransferFun f
-&gt; CmmGraph
-&gt; FactBase f
-&gt; FactBase f
</span><a href="GHC.Cmm.Dataflow.html#analyzeCmm"><span class="hs-identifier hs-var hs-var">analyzeCmm</span></a></span></span><span> </span><span id="local-6989586621681045560"><span class="annot"><span class="annottext">Direction
</span><a href="#local-6989586621681045560"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span id="local-6989586621681045559"><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045559"><span class="hs-identifier hs-var">lattice</span></a></span></span><span> </span><span id="local-6989586621681045558"><span class="annot"><span class="annottext">TransferFun f
</span><a href="#local-6989586621681045558"><span class="hs-identifier hs-var">transfer</span></a></span></span><span> </span><span id="local-6989586621681045557"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681045557"><span class="hs-identifier hs-var">cmmGraph</span></a></span></span><span> </span><span id="local-6989586621681045556"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045556"><span class="hs-identifier hs-var">initFact</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-110"></span><span>    </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">analyzeCmm</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-111"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681045555"><span class="annot"><span class="annottext">entry :: Label
</span><a href="#local-6989586621681045555"><span class="hs-identifier hs-var hs-var">entry</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; Label
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; Label
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681045557"><span class="hs-identifier hs-var">cmmGraph</span></a></span><span>
</span><span id="line-112"></span><span>        </span><span id="local-6989586621681045553"><span class="annot"><span class="annottext">hooplGraph :: Graph CmmNode C C
</span><a href="#local-6989586621681045553"><span class="hs-identifier hs-var hs-var">hooplGraph</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; Graph CmmNode C C
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; Graph n C C
</span><a href="GHC.Cmm.html#g_graph"><span class="hs-identifier hs-var hs-var">g_graph</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681045557"><span class="hs-identifier hs-var">cmmGraph</span></a></span><span>
</span><span id="line-113"></span><span>        </span><span id="local-6989586621681045551"><span class="annot"><span class="annottext">blockMap :: LabelMap CmmBlock
</span><a href="#local-6989586621681045551"><span class="hs-identifier hs-var hs-var">blockMap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-114"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Graph CmmNode C C
</span><a href="#local-6989586621681045553"><span class="hs-identifier hs-var">hooplGraph</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-115"></span><span>                </span><span class="annot"><a href="GHC.Cmm.Dataflow.Graph.html#GMany"><span class="hs-identifier hs-type">GMany</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeO C (Block CmmNode O C)
</span><a href="GHC.Cmm.Dataflow.Block.html#NothingO"><span class="hs-identifier hs-var">NothingO</span></a></span><span> </span><span id="local-6989586621681045547"><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045547"><span class="hs-identifier hs-var">bm</span></a></span></span><span> </span><span class="annot"><span class="annottext">MaybeO C (Block CmmNode C O)
</span><a href="GHC.Cmm.Dataflow.Block.html#NothingO"><span class="hs-identifier hs-var">NothingO</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045547"><span class="hs-identifier hs-var">bm</span></a></span><span>
</span><span id="line-116"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Direction
-&gt; DataflowLattice f
-&gt; TransferFun f
-&gt; Label
-&gt; LabelMap CmmBlock
-&gt; FactBase f
-&gt; FactBase f
forall f.
Direction
-&gt; DataflowLattice f
-&gt; TransferFun f
-&gt; Label
-&gt; LabelMap CmmBlock
-&gt; FactBase f
-&gt; FactBase f
</span><a href="GHC.Cmm.Dataflow.html#fixpointAnalysis"><span class="hs-identifier hs-var">fixpointAnalysis</span></a></span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="#local-6989586621681045560"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045559"><span class="hs-identifier hs-var">lattice</span></a></span><span> </span><span class="annot"><span class="annottext">TransferFun f
</span><a href="#local-6989586621681045558"><span class="hs-identifier hs-var">transfer</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045555"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045551"><span class="hs-identifier hs-var">blockMap</span></a></span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045556"><span class="hs-identifier hs-var">initFact</span></a></span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span class="hs-comment">-- Fixpoint algorithm.</span><span>
</span><span id="line-119"></span><span class="annot"><a href="GHC.Cmm.Dataflow.html#fixpointAnalysis"><span class="hs-identifier hs-type">fixpointAnalysis</span></a></span><span>
</span><span id="line-120"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621681045700"><span class="annot"><a href="#local-6989586621681045700"><span class="hs-identifier hs-type">f</span></a></span></span><span class="hs-operator">.</span><span>
</span><span id="line-121"></span><span>       </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#Direction"><span class="hs-identifier hs-type">Direction</span></a></span><span>
</span><span id="line-122"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-type">DataflowLattice</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045700"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-123"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#TransferFun"><span class="hs-identifier hs-type">TransferFun</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045700"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-124"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span>
</span><span id="line-125"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span>
</span><span id="line-126"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045700"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-127"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045700"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-128"></span><span id="fixpointAnalysis"><span class="annot"><span class="annottext">fixpointAnalysis :: forall f.
Direction
-&gt; DataflowLattice f
-&gt; TransferFun f
-&gt; Label
-&gt; LabelMap CmmBlock
-&gt; FactBase f
-&gt; FactBase f
</span><a href="GHC.Cmm.Dataflow.html#fixpointAnalysis"><span class="hs-identifier hs-var hs-var">fixpointAnalysis</span></a></span></span><span> </span><span id="local-6989586621681045529"><span class="annot"><span class="annottext">Direction
</span><a href="#local-6989586621681045529"><span class="hs-identifier hs-var">direction</span></a></span></span><span> </span><span id="local-6989586621681045528"><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045528"><span class="hs-identifier hs-var">lattice</span></a></span></span><span> </span><span id="local-6989586621681045527"><span class="annot"><span class="annottext">TransferFun f
</span><a href="#local-6989586621681045527"><span class="hs-identifier hs-var">do_block</span></a></span></span><span> </span><span id="local-6989586621681045526"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045526"><span class="hs-identifier hs-var">entry</span></a></span></span><span> </span><span id="local-6989586621681045525"><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045525"><span class="hs-identifier hs-var">blockmap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntHeap -&gt; FactBase f -&gt; FactBase f
</span><a href="#local-6989586621681045524"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045523"><span class="hs-identifier hs-var">start</span></a></span><span>
</span><span id="line-129"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-130"></span><span>    </span><span class="hs-comment">-- Sorting the blocks helps to minimize the number of times we need to</span><span>
</span><span id="line-131"></span><span>    </span><span class="hs-comment">-- process blocks. For instance, for forward analysis we want to look at</span><span>
</span><span id="line-132"></span><span>    </span><span class="hs-comment">-- blocks in reverse postorder. Also, see comments for sortBlocks.</span><span>
</span><span id="line-133"></span><span>    </span><span id="local-6989586621681045522"><span class="annot"><span class="annottext">blocks :: [CmmBlock]
</span><a href="#local-6989586621681045522"><span class="hs-identifier hs-var hs-var">blocks</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Direction -&gt; Label -&gt; LabelMap CmmBlock -&gt; [CmmBlock]
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
NonLocal n =&gt;
Direction -&gt; Label -&gt; LabelMap (Block n C C) -&gt; [Block n C C]
</span><a href="GHC.Cmm.Dataflow.html#sortBlocks"><span class="hs-identifier hs-var">sortBlocks</span></a></span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="#local-6989586621681045529"><span class="hs-identifier hs-var">direction</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045526"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045525"><span class="hs-identifier hs-var">blockmap</span></a></span><span>
</span><span id="line-134"></span><span>    </span><span id="local-6989586621681045520"><span class="annot"><span class="annottext">num_blocks :: Int
</span><a href="#local-6989586621681045520"><span class="hs-identifier hs-var hs-var">num_blocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CmmBlock] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681045522"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-135"></span><span>    </span><span id="local-6989586621681045518"><span class="annot"><span class="annottext">block_arr :: Array Int CmmBlock
</span><a href="#local-6989586621681045518"><span class="hs-identifier hs-var hs-var">block_arr</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;block_arr&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><span class="annottext">(Int, Int) -&gt; [CmmBlock] -&gt; Array Int CmmBlock
forall i e. Ix i =&gt; (i, i) -&gt; [e] -&gt; Array i e
</span><a href="../../base/src/GHC.Arr.html#listArray"><span class="hs-identifier hs-var">listArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045520"><span class="hs-identifier hs-var">num_blocks</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681045522"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-136"></span><span>    </span><span id="local-6989586621681045523"><span class="annot"><span class="annottext">start :: IntHeap
</span><a href="#local-6989586621681045523"><span class="hs-identifier hs-var hs-var">start</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;start&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><span class="annottext">[Int] -&gt; IntHeap
</span><a href="../../containers/src/Data.IntSet.Internal.html#fromDistinctAscList"><span class="hs-identifier hs-var">IntSet.fromDistinctAscList</span></a></span><span>
</span><span id="line-137"></span><span>      </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045520"><span class="hs-identifier hs-var">num_blocks</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">]</span><span>
</span><span id="line-138"></span><span>    </span><span id="local-6989586621681045515"><span class="annot"><span class="annottext">dep_blocks :: LabelMap IntHeap
</span><a href="#local-6989586621681045515"><span class="hs-identifier hs-var hs-var">dep_blocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;dep_blocks&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><span class="annottext">Direction -&gt; [CmmBlock] -&gt; LabelMap IntHeap
</span><a href="GHC.Cmm.Dataflow.html#mkDepBlocks"><span class="hs-identifier hs-var">mkDepBlocks</span></a></span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="#local-6989586621681045529"><span class="hs-identifier hs-var">direction</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681045522"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-139"></span><span>    </span><span id="local-6989586621681045513"><span class="annot"><span class="annottext">join :: JoinFun f
</span><a href="#local-6989586621681045513"><span class="hs-identifier hs-var hs-var">join</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataflowLattice f -&gt; JoinFun f
forall a. DataflowLattice a -&gt; JoinFun a
</span><a href="GHC.Cmm.Dataflow.html#fact_join"><span class="hs-identifier hs-var hs-var">fact_join</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045528"><span class="hs-identifier hs-var">lattice</span></a></span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span>    </span><span class="annot"><a href="#local-6989586621681045524"><span class="hs-identifier hs-type">loop</span></a></span><span>
</span><span id="line-142"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#IntHeap"><span class="hs-identifier hs-type">IntHeap</span></a></span><span>     </span><span class="hs-comment">-- ^ Worklist, i.e., blocks to process</span><span>
</span><span id="line-143"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045700"><span class="hs-identifier hs-type">f</span></a></span><span>  </span><span class="hs-comment">-- ^ Current result (increases monotonically)</span><span>
</span><span id="line-144"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045700"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-145"></span><span>    </span><span id="local-6989586621681045524"><span class="annot"><span class="annottext">loop :: IntHeap -&gt; FactBase f -&gt; FactBase f
</span><a href="#local-6989586621681045524"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621681045512"><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045512"><span class="hs-identifier hs-var">todo</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045511"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045511"><span class="hs-identifier hs-var">fbase1</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681045510"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045510"><span class="hs-identifier hs-var">index</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681045509"><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045509"><span class="hs-identifier hs-var">todo1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IntHeap -&gt; Maybe (Int, IntHeap)
</span><a href="../../containers/src/Data.IntSet.Internal.html#minView"><span class="hs-identifier hs-var">IntSet.minView</span></a></span><span> </span><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045512"><span class="hs-identifier hs-var">todo</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-146"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681045507"><span class="annot"><span class="annottext">block :: CmmBlock
</span><a href="#local-6989586621681045507"><span class="hs-identifier hs-var hs-var">block</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array Int CmmBlock
</span><a href="#local-6989586621681045518"><span class="hs-identifier hs-var">block_arr</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int CmmBlock -&gt; Int -&gt; CmmBlock
forall i e. Ix i =&gt; Array i e -&gt; i -&gt; e
</span><a href="../../base/src/GHC.Arr.html#%21"><span class="hs-operator hs-var">!</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045510"><span class="hs-identifier hs-var">index</span></a></span><span>
</span><span id="line-147"></span><span>            </span><span id="local-6989586621681045505"><span class="annot"><span class="annottext">out_facts :: FactBase f
</span><a href="#local-6989586621681045505"><span class="hs-identifier hs-var hs-var">out_facts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;do_block&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><span class="annottext">TransferFun f
</span><a href="#local-6989586621681045527"><span class="hs-identifier hs-var">do_block</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681045507"><span class="hs-identifier hs-var">block</span></a></span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045511"><span class="hs-identifier hs-var">fbase1</span></a></span><span>
</span><span id="line-148"></span><span>            </span><span class="hs-comment">-- For each of the outgoing edges, we join it with the current</span><span>
</span><span id="line-149"></span><span>            </span><span class="hs-comment">-- information in fbase1 and (if something changed) we update it</span><span>
</span><span id="line-150"></span><span>            </span><span class="hs-comment">-- and add the affected blocks to the worklist.</span><span>
</span><span id="line-151"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681045504"><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045504"><span class="hs-identifier hs-var">todo2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681045503"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045503"><span class="hs-identifier hs-var">fbase2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;mapFoldWithKey&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-152"></span><span>                </span><span class="annot"><span class="annottext">((IntHeap, FactBase f)
 -&gt; KeyOf LabelMap -&gt; f -&gt; (IntHeap, FactBase f))
-&gt; (IntHeap, FactBase f) -&gt; FactBase f -&gt; (IntHeap, FactBase f)
forall (map :: * -&gt; *) b a.
IsMap map =&gt;
(b -&gt; KeyOf map -&gt; a -&gt; b) -&gt; b -&gt; map a -&gt; b
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFoldlWithKey"><span class="hs-identifier hs-var">mapFoldlWithKey</span></a></span><span>
</span><span id="line-153"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">JoinFun f
-&gt; LabelMap IntHeap
-&gt; (IntHeap, FactBase f)
-&gt; Label
-&gt; f
-&gt; (IntHeap, FactBase f)
forall f.
JoinFun f
-&gt; LabelMap IntHeap
-&gt; (IntHeap, FactBase f)
-&gt; Label
-&gt; f
-&gt; (IntHeap, FactBase f)
</span><a href="GHC.Cmm.Dataflow.html#updateFact"><span class="hs-identifier hs-var">updateFact</span></a></span><span> </span><span class="annot"><span class="annottext">JoinFun f
</span><a href="#local-6989586621681045513"><span class="hs-identifier hs-var">join</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap IntHeap
</span><a href="#local-6989586621681045515"><span class="hs-identifier hs-var">dep_blocks</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045509"><span class="hs-identifier hs-var">todo1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045511"><span class="hs-identifier hs-var">fbase1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045505"><span class="hs-identifier hs-var">out_facts</span></a></span><span>
</span><span id="line-154"></span><span>        </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">IntHeap -&gt; FactBase f -&gt; FactBase f
</span><a href="#local-6989586621681045524"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045504"><span class="hs-identifier hs-var">todo2</span></a></span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045503"><span class="hs-identifier hs-var">fbase2</span></a></span><span>
</span><span id="line-155"></span><span>    </span><span class="annot"><a href="#local-6989586621681045524"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">IntHeap
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045500"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045500"><span class="hs-identifier hs-var">fbase1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045500"><span class="hs-identifier hs-var">fbase1</span></a></span><span>
</span><span id="line-156"></span><span>
</span><span id="line-157"></span><span id="local-6989586621681045684"><span class="annot"><a href="GHC.Cmm.Dataflow.html#rewriteCmmBwd"><span class="hs-identifier hs-type">rewriteCmmBwd</span></a></span><span>
</span><span id="line-158"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-type">DataflowLattice</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045684"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-159"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#RewriteFun"><span class="hs-identifier hs-type">RewriteFun</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045684"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-160"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-161"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045684"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-162"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045684"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-163"></span><span id="rewriteCmmBwd"><span class="annot"><span class="annottext">rewriteCmmBwd :: forall f.
DataflowLattice f
-&gt; RewriteFun f
-&gt; CmmGraph
-&gt; FactBase f
-&gt; UniqSM (CmmGraph, FactBase f)
</span><a href="GHC.Cmm.Dataflow.html#rewriteCmmBwd"><span class="hs-identifier hs-var hs-var">rewriteCmmBwd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Direction
-&gt; DataflowLattice f
-&gt; RewriteFun f
-&gt; CmmGraph
-&gt; FactBase f
-&gt; UniqSM (CmmGraph, FactBase f)
forall f.
Direction
-&gt; DataflowLattice f
-&gt; RewriteFun f
-&gt; CmmGraph
-&gt; FactBase f
-&gt; UniqSM (CmmGraph, FactBase f)
</span><a href="GHC.Cmm.Dataflow.html#rewriteCmm"><span class="hs-identifier hs-var">rewriteCmm</span></a></span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="GHC.Cmm.Dataflow.html#Bwd"><span class="hs-identifier hs-var">Bwd</span></a></span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span id="local-6989586621681045680"><span class="annot"><a href="GHC.Cmm.Dataflow.html#rewriteCmm"><span class="hs-identifier hs-type">rewriteCmm</span></a></span><span>
</span><span id="line-166"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#Direction"><span class="hs-identifier hs-type">Direction</span></a></span><span>
</span><span id="line-167"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-type">DataflowLattice</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045680"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-168"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#RewriteFun"><span class="hs-identifier hs-type">RewriteFun</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045680"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-169"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-170"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045680"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-171"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045680"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-172"></span><span id="rewriteCmm"><span class="annot"><span class="annottext">rewriteCmm :: forall f.
Direction
-&gt; DataflowLattice f
-&gt; RewriteFun f
-&gt; CmmGraph
-&gt; FactBase f
-&gt; UniqSM (CmmGraph, FactBase f)
</span><a href="GHC.Cmm.Dataflow.html#rewriteCmm"><span class="hs-identifier hs-var hs-var">rewriteCmm</span></a></span></span><span> </span><span id="local-6989586621681045495"><span class="annot"><span class="annottext">Direction
</span><a href="#local-6989586621681045495"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span id="local-6989586621681045494"><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045494"><span class="hs-identifier hs-var">lattice</span></a></span></span><span> </span><span id="local-6989586621681045493"><span class="annot"><span class="annottext">RewriteFun f
</span><a href="#local-6989586621681045493"><span class="hs-identifier hs-var">rwFun</span></a></span></span><span> </span><span id="local-6989586621681045492"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681045492"><span class="hs-identifier hs-var">cmmGraph</span></a></span></span><span> </span><span id="local-6989586621681045491"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045491"><span class="hs-identifier hs-var">initFact</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">rewriteCmm</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-173"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681045490"><span class="annot"><span class="annottext">entry :: Label
</span><a href="#local-6989586621681045490"><span class="hs-identifier hs-var hs-var">entry</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; Label
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; Label
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681045492"><span class="hs-identifier hs-var">cmmGraph</span></a></span><span>
</span><span id="line-174"></span><span>        </span><span id="local-6989586621681045489"><span class="annot"><span class="annottext">hooplGraph :: Graph CmmNode C C
</span><a href="#local-6989586621681045489"><span class="hs-identifier hs-var hs-var">hooplGraph</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; Graph CmmNode C C
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; Graph n C C
</span><a href="GHC.Cmm.html#g_graph"><span class="hs-identifier hs-var hs-var">g_graph</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681045492"><span class="hs-identifier hs-var">cmmGraph</span></a></span><span>
</span><span id="line-175"></span><span>        </span><span id="local-6989586621681045488"><span class="annot"><span class="annottext">blockMap1 :: LabelMap CmmBlock
</span><a href="#local-6989586621681045488"><span class="hs-identifier hs-var hs-var">blockMap1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-176"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Graph CmmNode C C
</span><a href="#local-6989586621681045489"><span class="hs-identifier hs-var">hooplGraph</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-177"></span><span>                </span><span class="annot"><a href="GHC.Cmm.Dataflow.Graph.html#GMany"><span class="hs-identifier hs-type">GMany</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeO C (Block CmmNode O C)
</span><a href="GHC.Cmm.Dataflow.Block.html#NothingO"><span class="hs-identifier hs-var">NothingO</span></a></span><span> </span><span id="local-6989586621681045486"><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045486"><span class="hs-identifier hs-var">bm</span></a></span></span><span> </span><span class="annot"><span class="annottext">MaybeO C (Block CmmNode C O)
</span><a href="GHC.Cmm.Dataflow.Block.html#NothingO"><span class="hs-identifier hs-var">NothingO</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045486"><span class="hs-identifier hs-var">bm</span></a></span><span>
</span><span id="line-178"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681045484"><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045484"><span class="hs-identifier hs-var">blockMap2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681045483"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045483"><span class="hs-identifier hs-var">facts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-179"></span><span>        </span><span class="annot"><span class="annottext">Direction
-&gt; DataflowLattice f
-&gt; RewriteFun f
-&gt; Label
-&gt; LabelMap CmmBlock
-&gt; FactBase f
-&gt; UniqSM (LabelMap CmmBlock, FactBase f)
forall f.
Direction
-&gt; DataflowLattice f
-&gt; RewriteFun f
-&gt; Label
-&gt; LabelMap CmmBlock
-&gt; FactBase f
-&gt; UniqSM (LabelMap CmmBlock, FactBase f)
</span><a href="GHC.Cmm.Dataflow.html#fixpointRewrite"><span class="hs-identifier hs-var">fixpointRewrite</span></a></span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="#local-6989586621681045495"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045494"><span class="hs-identifier hs-var">lattice</span></a></span><span> </span><span class="annot"><span class="annottext">RewriteFun f
</span><a href="#local-6989586621681045493"><span class="hs-identifier hs-var">rwFun</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045490"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045488"><span class="hs-identifier hs-var">blockMap1</span></a></span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045491"><span class="hs-identifier hs-var">initFact</span></a></span><span>
</span><span id="line-180"></span><span>    </span><span class="annot"><span class="annottext">(CmmGraph, FactBase f) -&gt; UniqSM (CmmGraph, FactBase f)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681045492"><span class="hs-identifier hs-var">cmmGraph</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">g_graph :: Graph CmmNode C C
</span><a href="GHC.Cmm.html#g_graph"><span class="hs-identifier hs-var">g_graph</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MaybeO C (Block CmmNode O C)
-&gt; LabelMap CmmBlock
-&gt; MaybeO C (Block CmmNode C O)
-&gt; Graph CmmNode C C
forall (e :: Extensibility)
       (block :: (Extensibility -&gt; Extensibility -&gt; *)
                 -&gt; Extensibility -&gt; Extensibility -&gt; *)
       (n :: Extensibility -&gt; Extensibility -&gt; *) (x :: Extensibility).
MaybeO e (block n O C)
-&gt; Body' block n -&gt; MaybeO x (block n C O) -&gt; Graph' block n e x
</span><a href="GHC.Cmm.Dataflow.Graph.html#GMany"><span class="hs-identifier hs-var">GMany</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeO C (Block CmmNode O C)
forall t. MaybeO C t
</span><a href="GHC.Cmm.Dataflow.Block.html#NothingO"><span class="hs-identifier hs-var">NothingO</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045484"><span class="hs-identifier hs-var">blockMap2</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeO C (Block CmmNode C O)
forall t. MaybeO C t
</span><a href="GHC.Cmm.Dataflow.Block.html#NothingO"><span class="hs-identifier hs-var">NothingO</span></a></span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045483"><span class="hs-identifier hs-var">facts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span class="annot"><a href="GHC.Cmm.Dataflow.html#fixpointRewrite"><span class="hs-identifier hs-type">fixpointRewrite</span></a></span><span>
</span><span id="line-183"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621681045678"><span class="annot"><a href="#local-6989586621681045678"><span class="hs-identifier hs-type">f</span></a></span></span><span class="hs-operator">.</span><span>
</span><span id="line-184"></span><span>       </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#Direction"><span class="hs-identifier hs-type">Direction</span></a></span><span>
</span><span id="line-185"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-type">DataflowLattice</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045678"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-186"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#RewriteFun"><span class="hs-identifier hs-type">RewriteFun</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045678"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-187"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span>
</span><span id="line-188"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span>
</span><span id="line-189"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045678"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-190"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045678"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span id="fixpointRewrite"><span class="annot"><span class="annottext">fixpointRewrite :: forall f.
Direction
-&gt; DataflowLattice f
-&gt; RewriteFun f
-&gt; Label
-&gt; LabelMap CmmBlock
-&gt; FactBase f
-&gt; UniqSM (LabelMap CmmBlock, FactBase f)
</span><a href="GHC.Cmm.Dataflow.html#fixpointRewrite"><span class="hs-identifier hs-var hs-var">fixpointRewrite</span></a></span></span><span> </span><span id="local-6989586621681045466"><span class="annot"><span class="annottext">Direction
</span><a href="#local-6989586621681045466"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span id="local-6989586621681045465"><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045465"><span class="hs-identifier hs-var">lattice</span></a></span></span><span> </span><span id="local-6989586621681045464"><span class="annot"><span class="annottext">RewriteFun f
</span><a href="#local-6989586621681045464"><span class="hs-identifier hs-var">do_block</span></a></span></span><span> </span><span id="local-6989586621681045463"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045463"><span class="hs-identifier hs-var">entry</span></a></span></span><span> </span><span id="local-6989586621681045462"><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045462"><span class="hs-identifier hs-var">blockmap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntHeap
-&gt; LabelMap CmmBlock
-&gt; FactBase f
-&gt; UniqSM (LabelMap CmmBlock, FactBase f)
</span><a href="#local-6989586621681045461"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045460"><span class="hs-identifier hs-var">start</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045462"><span class="hs-identifier hs-var">blockmap</span></a></span><span>
</span><span id="line-192"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-193"></span><span>    </span><span class="hs-comment">-- Sorting the blocks helps to minimize the number of times we need to</span><span>
</span><span id="line-194"></span><span>    </span><span class="hs-comment">-- process blocks. For instance, for forward analysis we want to look at</span><span>
</span><span id="line-195"></span><span>    </span><span class="hs-comment">-- blocks in reverse postorder. Also, see comments for sortBlocks.</span><span>
</span><span id="line-196"></span><span>    </span><span id="local-6989586621681045459"><span class="annot"><span class="annottext">blocks :: [CmmBlock]
</span><a href="#local-6989586621681045459"><span class="hs-identifier hs-var hs-var">blocks</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Direction -&gt; Label -&gt; LabelMap CmmBlock -&gt; [CmmBlock]
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
NonLocal n =&gt;
Direction -&gt; Label -&gt; LabelMap (Block n C C) -&gt; [Block n C C]
</span><a href="GHC.Cmm.Dataflow.html#sortBlocks"><span class="hs-identifier hs-var">sortBlocks</span></a></span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="#local-6989586621681045466"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045463"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045462"><span class="hs-identifier hs-var">blockmap</span></a></span><span>
</span><span id="line-197"></span><span>    </span><span id="local-6989586621681045458"><span class="annot"><span class="annottext">num_blocks :: Int
</span><a href="#local-6989586621681045458"><span class="hs-identifier hs-var hs-var">num_blocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CmmBlock] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681045459"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-198"></span><span>    </span><span id="local-6989586621681045457"><span class="annot"><span class="annottext">block_arr :: Array Int CmmBlock
</span><a href="#local-6989586621681045457"><span class="hs-identifier hs-var hs-var">block_arr</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;block_arr_rewrite&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-199"></span><span>                 </span><span class="annot"><span class="annottext">(Int, Int) -&gt; [CmmBlock] -&gt; Array Int CmmBlock
forall i e. Ix i =&gt; (i, i) -&gt; [e] -&gt; Array i e
</span><a href="../../base/src/GHC.Arr.html#listArray"><span class="hs-identifier hs-var">listArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045458"><span class="hs-identifier hs-var">num_blocks</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681045459"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-200"></span><span>    </span><span id="local-6989586621681045460"><span class="annot"><span class="annottext">start :: IntHeap
</span><a href="#local-6989586621681045460"><span class="hs-identifier hs-var hs-var">start</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;start_rewrite&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-201"></span><span>                 </span><span class="annot"><span class="annottext">[Int] -&gt; IntHeap
</span><a href="../../containers/src/Data.IntSet.Internal.html#fromDistinctAscList"><span class="hs-identifier hs-var">IntSet.fromDistinctAscList</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045458"><span class="hs-identifier hs-var">num_blocks</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">]</span><span>
</span><span id="line-202"></span><span>    </span><span id="local-6989586621681045456"><span class="annot"><span class="annottext">dep_blocks :: LabelMap IntHeap
</span><a href="#local-6989586621681045456"><span class="hs-identifier hs-var hs-var">dep_blocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;dep_blocks_rewrite&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><span class="annottext">Direction -&gt; [CmmBlock] -&gt; LabelMap IntHeap
</span><a href="GHC.Cmm.Dataflow.html#mkDepBlocks"><span class="hs-identifier hs-var">mkDepBlocks</span></a></span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="#local-6989586621681045466"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681045459"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-203"></span><span>    </span><span id="local-6989586621681045455"><span class="annot"><span class="annottext">join :: JoinFun f
</span><a href="#local-6989586621681045455"><span class="hs-identifier hs-var hs-var">join</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataflowLattice f -&gt; JoinFun f
forall a. DataflowLattice a -&gt; JoinFun a
</span><a href="GHC.Cmm.Dataflow.html#fact_join"><span class="hs-identifier hs-var hs-var">fact_join</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045465"><span class="hs-identifier hs-var">lattice</span></a></span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span>    </span><span class="annot"><a href="#local-6989586621681045461"><span class="hs-identifier hs-type">loop</span></a></span><span>
</span><span id="line-206"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#IntHeap"><span class="hs-identifier hs-type">IntHeap</span></a></span><span>            </span><span class="hs-comment">-- ^ Worklist, i.e., blocks to process</span><span>
</span><span id="line-207"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span>  </span><span class="hs-comment">-- ^ Rewritten blocks.</span><span>
</span><span id="line-208"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045678"><span class="hs-identifier hs-type">f</span></a></span><span>         </span><span class="hs-comment">-- ^ Current facts.</span><span>
</span><span id="line-209"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045678"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-210"></span><span>    </span><span id="local-6989586621681045461"><span class="annot"><span class="annottext">loop :: IntHeap
-&gt; LabelMap CmmBlock
-&gt; FactBase f
-&gt; UniqSM (LabelMap CmmBlock, FactBase f)
</span><a href="#local-6989586621681045461"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621681045454"><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045454"><span class="hs-identifier hs-var">todo</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045453"><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045453"><span class="hs-identifier hs-var">blocks1</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045452"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045452"><span class="hs-identifier hs-var">fbase1</span></a></span></span><span>
</span><span id="line-211"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681045451"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045451"><span class="hs-identifier hs-var">index</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681045450"><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045450"><span class="hs-identifier hs-var">todo1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IntHeap -&gt; Maybe (Int, IntHeap)
</span><a href="../../containers/src/Data.IntSet.Internal.html#minView"><span class="hs-identifier hs-var">IntSet.minView</span></a></span><span> </span><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045454"><span class="hs-identifier hs-var">todo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-212"></span><span>        </span><span class="hs-comment">-- Note that we use the *original* block here. This is important.</span><span>
</span><span id="line-213"></span><span>        </span><span class="hs-comment">-- We're optimistically rewriting blocks even before reaching the fixed</span><span>
</span><span id="line-214"></span><span>        </span><span class="hs-comment">-- point, which means that the rewrite might be incorrect. So if the</span><span>
</span><span id="line-215"></span><span>        </span><span class="hs-comment">-- facts change, we need to rewrite the original block again (taking</span><span>
</span><span id="line-216"></span><span>        </span><span class="hs-comment">-- into account the new facts).</span><span>
</span><span id="line-217"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681045449"><span class="annot"><span class="annottext">block :: CmmBlock
</span><a href="#local-6989586621681045449"><span class="hs-identifier hs-var hs-var">block</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array Int CmmBlock
</span><a href="#local-6989586621681045457"><span class="hs-identifier hs-var">block_arr</span></a></span><span> </span><span class="annot"><span class="annottext">Array Int CmmBlock -&gt; Int -&gt; CmmBlock
forall i e. Ix i =&gt; Array i e -&gt; i -&gt; e
</span><a href="../../base/src/GHC.Arr.html#%21"><span class="hs-operator hs-var">!</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045451"><span class="hs-identifier hs-var">index</span></a></span><span>
</span><span id="line-218"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681045448"><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681045448"><span class="hs-identifier hs-var">new_block</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681045447"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045447"><span class="hs-identifier hs-var">out_facts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;do_block_rewrite&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-219"></span><span>            </span><span class="annot"><span class="annottext">RewriteFun f
</span><a href="#local-6989586621681045464"><span class="hs-identifier hs-var">do_block</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681045449"><span class="hs-identifier hs-var">block</span></a></span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045452"><span class="hs-identifier hs-var">fbase1</span></a></span><span>
</span><span id="line-220"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681045446"><span class="annot"><span class="annottext">blocks2 :: LabelMap CmmBlock
</span><a href="#local-6989586621681045446"><span class="hs-identifier hs-var hs-var">blocks2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; CmmBlock -&gt; LabelMap CmmBlock -&gt; LabelMap CmmBlock
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmBlock -&gt; Label
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
NonLocal thing =&gt;
thing C x -&gt; Label
</span><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier hs-var">entryLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681045448"><span class="hs-identifier hs-var">new_block</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681045448"><span class="hs-identifier hs-var">new_block</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045453"><span class="hs-identifier hs-var">blocks1</span></a></span><span>
</span><span id="line-221"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621681045444"><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045444"><span class="hs-identifier hs-var">todo2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681045443"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045443"><span class="hs-identifier hs-var">fbase2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;mapFoldWithKey_rewrite&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-222"></span><span>                </span><span class="annot"><span class="annottext">((IntHeap, FactBase f)
 -&gt; KeyOf LabelMap -&gt; f -&gt; (IntHeap, FactBase f))
-&gt; (IntHeap, FactBase f) -&gt; FactBase f -&gt; (IntHeap, FactBase f)
forall (map :: * -&gt; *) b a.
IsMap map =&gt;
(b -&gt; KeyOf map -&gt; a -&gt; b) -&gt; b -&gt; map a -&gt; b
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFoldlWithKey"><span class="hs-identifier hs-var">mapFoldlWithKey</span></a></span><span>
</span><span id="line-223"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">JoinFun f
-&gt; LabelMap IntHeap
-&gt; (IntHeap, FactBase f)
-&gt; Label
-&gt; f
-&gt; (IntHeap, FactBase f)
forall f.
JoinFun f
-&gt; LabelMap IntHeap
-&gt; (IntHeap, FactBase f)
-&gt; Label
-&gt; f
-&gt; (IntHeap, FactBase f)
</span><a href="GHC.Cmm.Dataflow.html#updateFact"><span class="hs-identifier hs-var">updateFact</span></a></span><span> </span><span class="annot"><span class="annottext">JoinFun f
</span><a href="#local-6989586621681045455"><span class="hs-identifier hs-var">join</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap IntHeap
</span><a href="#local-6989586621681045456"><span class="hs-identifier hs-var">dep_blocks</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045450"><span class="hs-identifier hs-var">todo1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045452"><span class="hs-identifier hs-var">fbase1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045447"><span class="hs-identifier hs-var">out_facts</span></a></span><span>
</span><span id="line-224"></span><span>        </span><span class="annot"><span class="annottext">IntHeap
-&gt; LabelMap CmmBlock
-&gt; FactBase f
-&gt; UniqSM (LabelMap CmmBlock, FactBase f)
</span><a href="#local-6989586621681045461"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045444"><span class="hs-identifier hs-var">todo2</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045446"><span class="hs-identifier hs-var">blocks2</span></a></span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045443"><span class="hs-identifier hs-var">fbase2</span></a></span><span>
</span><span id="line-225"></span><span>    </span><span class="annot"><a href="#local-6989586621681045461"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">IntHeap
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045442"><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045442"><span class="hs-identifier hs-var">blocks1</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045441"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045441"><span class="hs-identifier hs-var">fbase1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LabelMap CmmBlock, FactBase f)
-&gt; UniqSM (LabelMap CmmBlock, FactBase f)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681045442"><span class="hs-identifier hs-var">blocks1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045441"><span class="hs-identifier hs-var">fbase1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span class="hs-comment">{-
Note [Unreachable blocks]
~~~~~~~~~~~~~~~~~~~~~~~~~
A block that is not in the domain of tfb_fbase is &quot;currently unreachable&quot;.
A currently-unreachable block is not even analyzed.  Reason: consider
constant prop and this graph, with entry point L1:
  L1: x:=3; goto L4
  L2: x:=4; goto L4
  L4: if x&gt;3 goto L2 else goto L5
Here L2 is actually unreachable, but if we process it with bottom input fact,
we'll propagate (x=4) to L4, and nuke the otherwise-good rewriting of L4.

* If a currently-unreachable block is not analyzed, then its rewritten
  graph will not be accumulated in tfb_rg.  And that is good:
  unreachable blocks simply do not appear in the output.

* Note that clients must be careful to provide a fact (even if bottom)
  for each entry point. Otherwise useful blocks may be garbage collected.

* Note that updateFact must set the change-flag if a label goes from
  not-in-fbase to in-fbase, even if its fact is bottom.  In effect the
  real fact lattice is
       UNR
       bottom
       the points above bottom

* Even if the fact is going from UNR to bottom, we still call the
  client's fact_join function because it might give the client
  some useful debugging information.

* All of this only applies for *forward* ixpoints.  For the backward
  case we must treat every block as reachable; it might finish with a
  'return', and therefore have no successors, for example.
-}</span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-265"></span><span class="hs-comment">--  Pieces that are shared by fixpoint and fixpoint_anal</span><span>
</span><span id="line-266"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span class="hs-comment">-- | Sort the blocks into the right order for analysis. This means reverse</span><span>
</span><span id="line-269"></span><span class="hs-comment">-- postorder for a forward analysis. For the backward one, we simply reverse</span><span>
</span><span id="line-270"></span><span class="hs-comment">-- that (see Note [Backward vs forward analysis]).</span><span>
</span><span id="line-271"></span><span id="local-6989586621681045697"><span class="annot"><a href="GHC.Cmm.Dataflow.html#sortBlocks"><span class="hs-identifier hs-type">sortBlocks</span></a></span><span>
</span><span id="line-272"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Graph.html#NonLocal"><span class="hs-identifier hs-type">NonLocal</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045697"><span class="hs-identifier hs-type">n</span></a></span><span>
</span><span id="line-273"></span><span>    </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#Direction"><span class="hs-identifier hs-type">Direction</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045697"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045697"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-274"></span><span id="sortBlocks"><span class="annot"><span class="annottext">sortBlocks :: forall (n :: Extensibility -&gt; Extensibility -&gt; *).
NonLocal n =&gt;
Direction -&gt; Label -&gt; LabelMap (Block n C C) -&gt; [Block n C C]
</span><a href="GHC.Cmm.Dataflow.html#sortBlocks"><span class="hs-identifier hs-var hs-var">sortBlocks</span></a></span></span><span> </span><span id="local-6989586621681045438"><span class="annot"><span class="annottext">Direction
</span><a href="#local-6989586621681045438"><span class="hs-identifier hs-var">direction</span></a></span></span><span> </span><span id="local-6989586621681045437"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045437"><span class="hs-identifier hs-var">entry</span></a></span></span><span> </span><span id="local-6989586621681045436"><span class="annot"><span class="annottext">LabelMap (Block n C C)
</span><a href="#local-6989586621681045436"><span class="hs-identifier hs-var">blockmap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-275"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="#local-6989586621681045438"><span class="hs-identifier hs-var">direction</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-276"></span><span>        </span><span class="annot"><span class="annottext">Direction
</span><a href="GHC.Cmm.Dataflow.html#Fwd"><span class="hs-identifier hs-var">Fwd</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Block n C C]
</span><a href="#local-6989586621681045435"><span class="hs-identifier hs-var">fwd</span></a></span><span>
</span><span id="line-277"></span><span>        </span><span class="annot"><span class="annottext">Direction
</span><a href="GHC.Cmm.Dataflow.html#Bwd"><span class="hs-identifier hs-var">Bwd</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Block n C C] -&gt; [Block n C C]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[Block n C C]
</span><a href="#local-6989586621681045435"><span class="hs-identifier hs-var">fwd</span></a></span><span>
</span><span id="line-278"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-279"></span><span>    </span><span id="local-6989586621681045435"><span class="annot"><span class="annottext">fwd :: [Block n C C]
</span><a href="#local-6989586621681045435"><span class="hs-identifier hs-var hs-var">fwd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap (Block n C C) -&gt; Label -&gt; [Block n C C]
forall (block :: Extensibility -&gt; Extensibility -&gt; *).
NonLocal block =&gt;
LabelMap (block C C) -&gt; Label -&gt; [block C C]
</span><a href="GHC.Cmm.Dataflow.Graph.html#revPostorderFrom"><span class="hs-identifier hs-var">revPostorderFrom</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (Block n C C)
</span><a href="#local-6989586621681045436"><span class="hs-identifier hs-var">blockmap</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045437"><span class="hs-identifier hs-var">entry</span></a></span><span>
</span><span id="line-280"></span><span>
</span><span id="line-281"></span><span class="hs-comment">-- Note [Backward vs forward analysis]</span><span>
</span><span id="line-282"></span><span class="hs-comment">--</span><span>
</span><span id="line-283"></span><span class="hs-comment">-- The forward and backward cases are not dual.  In the forward case, the entry</span><span>
</span><span id="line-284"></span><span class="hs-comment">-- points are known, and one simply traverses the body blocks from those points.</span><span>
</span><span id="line-285"></span><span class="hs-comment">-- In the backward case, something is known about the exit points, but a</span><span>
</span><span id="line-286"></span><span class="hs-comment">-- backward analysis must also include reachable blocks that don't reach the</span><span>
</span><span id="line-287"></span><span class="hs-comment">-- exit, as in a procedure that loops forever and has side effects.)</span><span>
</span><span id="line-288"></span><span class="hs-comment">-- For instance, let E be the entry and X the exit blocks (arrows indicate</span><span>
</span><span id="line-289"></span><span class="hs-comment">-- control flow)</span><span>
</span><span id="line-290"></span><span class="hs-comment">--   E -&gt; X</span><span>
</span><span id="line-291"></span><span class="hs-comment">--   E -&gt; B</span><span>
</span><span id="line-292"></span><span class="hs-comment">--   B -&gt; C</span><span>
</span><span id="line-293"></span><span class="hs-comment">--   C -&gt; B</span><span>
</span><span id="line-294"></span><span class="hs-comment">-- We do need to include B and C even though they're unreachable in the</span><span>
</span><span id="line-295"></span><span class="hs-comment">-- *reverse* graph (that we could use for backward analysis):</span><span>
</span><span id="line-296"></span><span class="hs-comment">--   E &lt;- X</span><span>
</span><span id="line-297"></span><span class="hs-comment">--   E &lt;- B</span><span>
</span><span id="line-298"></span><span class="hs-comment">--   B &lt;- C</span><span>
</span><span id="line-299"></span><span class="hs-comment">--   C &lt;- B</span><span>
</span><span id="line-300"></span><span class="hs-comment">-- So when sorting the blocks for the backward analysis, we simply take the</span><span>
</span><span id="line-301"></span><span class="hs-comment">-- reverse of what is used for the forward one.</span><span>
</span><span id="line-302"></span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span class="hs-comment">-- | Construct a mapping from a @Label@ to the block indexes that should be</span><span>
</span><span id="line-305"></span><span class="hs-comment">-- re-analyzed if the facts at that @Label@ change.</span><span>
</span><span id="line-306"></span><span class="hs-comment">--</span><span>
</span><span id="line-307"></span><span class="hs-comment">-- Note that we're considering here the entry point of the block, so if the</span><span>
</span><span id="line-308"></span><span class="hs-comment">-- facts change at the entry:</span><span>
</span><span id="line-309"></span><span class="hs-comment">-- * for a backward analysis we need to re-analyze all the predecessors, but</span><span>
</span><span id="line-310"></span><span class="hs-comment">-- * for a forward analysis, we only need to re-analyze the current block</span><span>
</span><span id="line-311"></span><span class="hs-comment">--   (and that will in turn propagate facts into its successors).</span><span>
</span><span id="line-312"></span><span class="annot"><a href="GHC.Cmm.Dataflow.html#mkDepBlocks"><span class="hs-identifier hs-type">mkDepBlocks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#Direction"><span class="hs-identifier hs-type">Direction</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="../../containers/src/Data.IntSet.Internal.html#IntSet"><span class="hs-identifier hs-type">IntSet</span></a></span><span>
</span><span id="line-313"></span><span id="mkDepBlocks"><span class="annot"><span class="annottext">mkDepBlocks :: Direction -&gt; [CmmBlock] -&gt; LabelMap IntHeap
</span><a href="GHC.Cmm.Dataflow.html#mkDepBlocks"><span class="hs-identifier hs-var hs-var">mkDepBlocks</span></a></span></span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="GHC.Cmm.Dataflow.html#Fwd"><span class="hs-identifier hs-var">Fwd</span></a></span><span> </span><span id="local-6989586621681045432"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681045432"><span class="hs-identifier hs-var">blocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CmmBlock] -&gt; Int -&gt; LabelMap IntHeap -&gt; LabelMap IntHeap
forall {map :: * -&gt; *}
       {thing :: Extensibility -&gt; Extensibility -&gt; *}
       {x :: Extensibility}.
(IsMap map, NonLocal thing, KeyOf map ~ Label) =&gt;
[thing C x] -&gt; Int -&gt; map IntHeap -&gt; map IntHeap
</span><a href="#local-6989586621681045431"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681045432"><span class="hs-identifier hs-var">blocks</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">LabelMap IntHeap
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span>
</span><span id="line-314"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-315"></span><span>    </span><span id="local-6989586621681045431"><span class="annot"><span class="annottext">go :: [thing C x] -&gt; Int -&gt; map IntHeap -&gt; map IntHeap
</span><a href="#local-6989586621681045431"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">!</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045419"><span class="annot"><span class="annottext">map IntHeap
</span><a href="#local-6989586621681045419"><span class="hs-identifier hs-var">dep_map</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">map IntHeap
</span><a href="#local-6989586621681045419"><span class="hs-identifier hs-var">dep_map</span></a></span><span>
</span><span id="line-316"></span><span>    </span><span class="annot"><a href="#local-6989586621681045431"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681045418"><span class="annot"><span class="annottext">thing C x
</span><a href="#local-6989586621681045418"><span class="hs-identifier hs-var">b</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681045417"><span class="annot"><span class="annottext">[thing C x]
</span><a href="#local-6989586621681045417"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045416"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045416"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045415"><span class="annot"><span class="annottext">map IntHeap
</span><a href="#local-6989586621681045415"><span class="hs-identifier hs-var">dep_map</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-317"></span><span>        </span><span class="annot"><span class="annottext">[thing C x] -&gt; Int -&gt; map IntHeap -&gt; map IntHeap
</span><a href="#local-6989586621681045431"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[thing C x]
</span><a href="#local-6989586621681045417"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045416"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(map IntHeap -&gt; map IntHeap) -&gt; map IntHeap -&gt; map IntHeap
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf map -&gt; IntHeap -&gt; map IntHeap -&gt; map IntHeap
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">thing C x -&gt; Label
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
NonLocal thing =&gt;
thing C x -&gt; Label
</span><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier hs-var">entryLabel</span></a></span><span> </span><span class="annot"><span class="annottext">thing C x
</span><a href="#local-6989586621681045418"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; IntHeap
</span><a href="../../containers/src/Data.IntSet.Internal.html#singleton"><span class="hs-identifier hs-var">IntSet.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045416"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">map IntHeap
</span><a href="#local-6989586621681045415"><span class="hs-identifier hs-var">dep_map</span></a></span><span>
</span><span id="line-318"></span><span class="annot"><a href="GHC.Cmm.Dataflow.html#mkDepBlocks"><span class="hs-identifier hs-var">mkDepBlocks</span></a></span><span> </span><span class="annot"><span class="annottext">Direction
</span><a href="GHC.Cmm.Dataflow.html#Bwd"><span class="hs-identifier hs-var">Bwd</span></a></span><span> </span><span id="local-6989586621681045412"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681045412"><span class="hs-identifier hs-var">blocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CmmBlock] -&gt; Int -&gt; LabelMap IntHeap -&gt; LabelMap IntHeap
forall {map :: * -&gt; *}
       {thing :: Extensibility -&gt; Extensibility -&gt; *}
       {e :: Extensibility}.
(IsMap map, NonLocal thing, KeyOf map ~ Label) =&gt;
[thing e C] -&gt; Int -&gt; map IntHeap -&gt; map IntHeap
</span><a href="#local-6989586621681045411"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681045412"><span class="hs-identifier hs-var">blocks</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">LabelMap IntHeap
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span>
</span><span id="line-319"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-320"></span><span>    </span><span id="local-6989586621681045411"><span class="annot"><span class="annottext">go :: [thing e C] -&gt; Int -&gt; map IntHeap -&gt; map IntHeap
</span><a href="#local-6989586621681045411"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">!</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045399"><span class="annot"><span class="annottext">map IntHeap
</span><a href="#local-6989586621681045399"><span class="hs-identifier hs-var">dep_map</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">map IntHeap
</span><a href="#local-6989586621681045399"><span class="hs-identifier hs-var">dep_map</span></a></span><span>
</span><span id="line-321"></span><span>    </span><span class="annot"><a href="#local-6989586621681045411"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681045398"><span class="annot"><span class="annottext">thing e C
</span><a href="#local-6989586621681045398"><span class="hs-identifier hs-var">b</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681045397"><span class="annot"><span class="annottext">[thing e C]
</span><a href="#local-6989586621681045397"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045396"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045396"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045395"><span class="annot"><span class="annottext">map IntHeap
</span><a href="#local-6989586621681045395"><span class="hs-identifier hs-var">dep_map</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-322"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681045394"><span class="annot"><span class="annottext">insert :: map IntHeap -&gt; Label -&gt; map IntHeap
</span><a href="#local-6989586621681045394"><span class="hs-identifier hs-var hs-var">insert</span></a></span></span><span> </span><span id="local-6989586621681045393"><span class="annot"><span class="annottext">map IntHeap
</span><a href="#local-6989586621681045393"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621681045392"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045392"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(IntHeap -&gt; IntHeap -&gt; IntHeap)
-&gt; KeyOf map -&gt; IntHeap -&gt; map IntHeap -&gt; map IntHeap
forall (map :: * -&gt; *) a.
IsMap map =&gt;
(a -&gt; a -&gt; a) -&gt; KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsertWith"><span class="hs-identifier hs-var">mapInsertWith</span></a></span><span> </span><span class="annot"><span class="annottext">IntHeap -&gt; IntHeap -&gt; IntHeap
</span><a href="../../containers/src/Data.IntSet.Internal.html#union"><span class="hs-identifier hs-var">IntSet.union</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf map
Label
</span><a href="#local-6989586621681045392"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; IntHeap
</span><a href="../../containers/src/Data.IntSet.Internal.html#singleton"><span class="hs-identifier hs-var">IntSet.singleton</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045396"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">map IntHeap
</span><a href="#local-6989586621681045393"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-323"></span><span>        </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">[thing e C] -&gt; Int -&gt; map IntHeap -&gt; map IntHeap
</span><a href="#local-6989586621681045411"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[thing e C]
</span><a href="#local-6989586621681045397"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681045396"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(map IntHeap -&gt; map IntHeap) -&gt; map IntHeap -&gt; map IntHeap
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(map IntHeap -&gt; Label -&gt; map IntHeap)
-&gt; map IntHeap -&gt; [Label] -&gt; map IntHeap
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">map IntHeap -&gt; Label -&gt; map IntHeap
</span><a href="#local-6989586621681045394"><span class="hs-identifier hs-var">insert</span></a></span><span> </span><span class="annot"><span class="annottext">map IntHeap
</span><a href="#local-6989586621681045395"><span class="hs-identifier hs-var">dep_map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">thing e C -&gt; [Label]
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
NonLocal thing =&gt;
thing e C -&gt; [Label]
</span><a href="GHC.Cmm.Dataflow.Graph.html#successors"><span class="hs-identifier hs-var">successors</span></a></span><span> </span><span class="annot"><span class="annottext">thing e C
</span><a href="#local-6989586621681045398"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-324"></span><span>
</span><span id="line-325"></span><span class="hs-comment">-- | After some new facts have been generated by analysing a block, we</span><span>
</span><span id="line-326"></span><span class="hs-comment">-- fold this function over them to generate (a) a list of block</span><span>
</span><span id="line-327"></span><span class="hs-comment">-- indices to (re-)analyse, and (b) the new FactBase.</span><span>
</span><span id="line-328"></span><span id="local-6989586621681045685"><span class="annot"><a href="GHC.Cmm.Dataflow.html#updateFact"><span class="hs-identifier hs-type">updateFact</span></a></span><span>
</span><span id="line-329"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#JoinFun"><span class="hs-identifier hs-type">JoinFun</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045685"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-330"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="../../containers/src/Data.IntSet.Internal.html#IntSet"><span class="hs-identifier hs-type">IntSet</span></a></span><span>
</span><span id="line-331"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.html#IntHeap"><span class="hs-identifier hs-type">IntHeap</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045685"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-332"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span>
</span><span id="line-333"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045685"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-comment">-- out fact</span><span>
</span><span id="line-334"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.html#IntHeap"><span class="hs-identifier hs-type">IntHeap</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045685"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-335"></span><span id="updateFact"><span class="annot"><span class="annottext">updateFact :: forall f.
JoinFun f
-&gt; LabelMap IntHeap
-&gt; (IntHeap, FactBase f)
-&gt; Label
-&gt; f
-&gt; (IntHeap, FactBase f)
</span><a href="GHC.Cmm.Dataflow.html#updateFact"><span class="hs-identifier hs-var hs-var">updateFact</span></a></span></span><span> </span><span id="local-6989586621681045384"><span class="annot"><span class="annottext">JoinFun f
</span><a href="#local-6989586621681045384"><span class="hs-identifier hs-var">fact_join</span></a></span></span><span> </span><span id="local-6989586621681045383"><span class="annot"><span class="annottext">LabelMap IntHeap
</span><a href="#local-6989586621681045383"><span class="hs-identifier hs-var">dep_blocks</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681045382"><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045382"><span class="hs-identifier hs-var">todo</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681045381"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045381"><span class="hs-identifier hs-var">fbase</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681045380"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045380"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681045379"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045379"><span class="hs-identifier hs-var">new_fact</span></a></span></span><span>
</span><span id="line-336"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Label -&gt; FactBase f -&gt; Maybe f
forall f. Label -&gt; FactBase f -&gt; Maybe f
</span><a href="GHC.Cmm.Dataflow.Label.html#lookupFact"><span class="hs-identifier hs-var">lookupFact</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045380"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045381"><span class="hs-identifier hs-var">fbase</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-337"></span><span>      </span><span class="annot"><span class="annottext">Maybe f
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-338"></span><span>          </span><span class="hs-comment">-- Note [No old fact]</span><span>
</span><span id="line-339"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045377"><span class="annot"><span class="annottext">z :: FactBase f
</span><a href="#local-6989586621681045377"><span class="hs-identifier hs-var hs-var">z</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; f -&gt; FactBase f -&gt; FactBase f
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681045380"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045379"><span class="hs-identifier hs-var">new_fact</span></a></span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045381"><span class="hs-identifier hs-var">fbase</span></a></span><span> </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045376"><span class="hs-identifier hs-var">changed</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045377"><span class="hs-identifier hs-var">z</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-340"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681045375"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045375"><span class="hs-identifier hs-var">old_fact</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-341"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">JoinFun f
</span><a href="#local-6989586621681045384"><span class="hs-identifier hs-var">fact_join</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f -&gt; OldFact f
forall a. a -&gt; OldFact a
</span><a href="GHC.Cmm.Dataflow.html#OldFact"><span class="hs-identifier hs-var">OldFact</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045375"><span class="hs-identifier hs-var">old_fact</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f -&gt; NewFact f
forall a. a -&gt; NewFact a
</span><a href="GHC.Cmm.Dataflow.html#NewFact"><span class="hs-identifier hs-var">NewFact</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045379"><span class="hs-identifier hs-var">new_fact</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-342"></span><span>              </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.html#NotChanged"><span class="hs-identifier hs-type">NotChanged</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045382"><span class="hs-identifier hs-var">todo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045381"><span class="hs-identifier hs-var">fbase</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span>              </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.html#Changed"><span class="hs-identifier hs-type">Changed</span></a></span><span> </span><span id="local-6989586621681045374"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045374"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045373"><span class="annot"><span class="annottext">z :: FactBase f
</span><a href="#local-6989586621681045373"><span class="hs-identifier hs-var hs-var">z</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; f -&gt; FactBase f -&gt; FactBase f
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681045380"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045374"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045381"><span class="hs-identifier hs-var">fbase</span></a></span><span> </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045376"><span class="hs-identifier hs-var">changed</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045373"><span class="hs-identifier hs-var">z</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-344"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-345"></span><span>    </span><span id="local-6989586621681045376"><span class="annot"><span class="annottext">changed :: IntHeap
</span><a href="#local-6989586621681045376"><span class="hs-identifier hs-var hs-var">changed</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IntHeap
</span><a href="#local-6989586621681045382"><span class="hs-identifier hs-var">todo</span></a></span><span> </span><span class="annot"><span class="annottext">IntHeap -&gt; IntHeap -&gt; IntHeap
</span><a href="../../containers/src/Data.IntSet.Internal.html#union"><span class="hs-operator hs-var">`IntSet.union`</span></a></span><span>
</span><span id="line-346"></span><span>              </span><span class="annot"><span class="annottext">IntHeap -&gt; KeyOf LabelMap -&gt; LabelMap IntHeap -&gt; IntHeap
forall (map :: * -&gt; *) a. IsMap map =&gt; a -&gt; KeyOf map -&gt; map a -&gt; a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFindWithDefault"><span class="hs-identifier hs-var">mapFindWithDefault</span></a></span><span> </span><span class="annot"><span class="annottext">IntHeap
</span><a href="../../containers/src/Data.IntSet.Internal.html#empty"><span class="hs-identifier hs-var">IntSet.empty</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681045380"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap IntHeap
</span><a href="#local-6989586621681045383"><span class="hs-identifier hs-var">dep_blocks</span></a></span><span>
</span><span id="line-347"></span><span>
</span><span id="line-348"></span><span class="hs-comment">{-
Note [No old fact]

We know that the new_fact is &gt;= _|_, so we don't need to join.  However,
if the new fact is also _|_, and we have already analysed its block,
we don't need to record a change.  So there's a tradeoff here.  It turns
out that always recording a change is faster.
-}</span><span>
</span><span id="line-356"></span><span>
</span><span id="line-357"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-358"></span><span class="hs-comment">--       Utilities</span><span>
</span><span id="line-359"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-360"></span><span>
</span><span id="line-361"></span><span class="hs-comment">-- Fact lookup: the fact `orelse` bottom</span><span>
</span><span id="line-362"></span><span id="local-6989586621681045640"><span class="annot"><a href="GHC.Cmm.Dataflow.html#getFact"><span class="hs-identifier hs-type">getFact</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-type">DataflowLattice</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045640"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045640"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045640"><span class="hs-identifier hs-type">f</span></a></span></span><span>
</span><span id="line-363"></span><span id="getFact"><span class="annot"><span class="annottext">getFact :: forall f. DataflowLattice f -&gt; Label -&gt; FactBase f -&gt; f
</span><a href="GHC.Cmm.Dataflow.html#getFact"><span class="hs-identifier hs-var hs-var">getFact</span></a></span></span><span> </span><span id="local-6989586621681045370"><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045370"><span class="hs-identifier hs-var">lat</span></a></span></span><span> </span><span id="local-6989586621681045369"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045369"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681045368"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045368"><span class="hs-identifier hs-var">fb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Label -&gt; FactBase f -&gt; Maybe f
forall f. Label -&gt; FactBase f -&gt; Maybe f
</span><a href="GHC.Cmm.Dataflow.Label.html#lookupFact"><span class="hs-identifier hs-var">lookupFact</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045369"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045368"><span class="hs-identifier hs-var">fb</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span>  </span><span id="local-6989586621681045367"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045367"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045367"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-364"></span><span>                                           </span><span class="annot"><span class="annottext">Maybe f
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DataflowLattice f -&gt; f
forall a. DataflowLattice a -&gt; a
</span><a href="GHC.Cmm.Dataflow.html#fact_bot"><span class="hs-identifier hs-var hs-var">fact_bot</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045370"><span class="hs-identifier hs-var">lat</span></a></span><span>
</span><span id="line-365"></span><span>
</span><span id="line-366"></span><span class="hs-comment">-- | Returns the result of joining the facts from all the successors of the</span><span>
</span><span id="line-367"></span><span class="hs-comment">-- provided node or block.</span><span>
</span><span id="line-368"></span><span id="local-6989586621681045636"><span id="local-6989586621681045637"><span id="local-6989586621681045638"><span class="annot"><a href="GHC.Cmm.Dataflow.html#joinOutFacts"><span class="hs-identifier hs-type">joinOutFacts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Graph.html#NonLocal"><span class="hs-identifier hs-type">NonLocal</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045638"><span class="hs-identifier hs-type">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-type">DataflowLattice</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045637"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045638"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045636"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045637"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045637"><span class="hs-identifier hs-type">f</span></a></span></span></span></span><span>
</span><span id="line-369"></span><span id="joinOutFacts"><span class="annot"><span class="annottext">joinOutFacts :: forall (n :: Extensibility -&gt; Extensibility -&gt; *) f
       (e :: Extensibility).
NonLocal n =&gt;
DataflowLattice f -&gt; n e C -&gt; FactBase f -&gt; f
</span><a href="GHC.Cmm.Dataflow.html#joinOutFacts"><span class="hs-identifier hs-var hs-var">joinOutFacts</span></a></span></span><span> </span><span id="local-6989586621681045361"><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045361"><span class="hs-identifier hs-var">lattice</span></a></span></span><span> </span><span id="local-6989586621681045360"><span class="annot"><span class="annottext">n e C
</span><a href="#local-6989586621681045360"><span class="hs-identifier hs-var">nonLocal</span></a></span></span><span> </span><span id="local-6989586621681045359"><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045359"><span class="hs-identifier hs-var">fact_base</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(f -&gt; f -&gt; f) -&gt; f -&gt; [f] -&gt; f
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">f -&gt; f -&gt; f
</span><a href="#local-6989586621681045358"><span class="hs-identifier hs-var">join</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataflowLattice f -&gt; f
forall a. DataflowLattice a -&gt; a
</span><a href="GHC.Cmm.Dataflow.html#fact_bot"><span class="hs-identifier hs-var hs-var">fact_bot</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045361"><span class="hs-identifier hs-var">lattice</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[f]
</span><a href="#local-6989586621681045357"><span class="hs-identifier hs-var">facts</span></a></span><span>
</span><span id="line-370"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-371"></span><span>    </span><span id="local-6989586621681045358"><span class="annot"><span class="annottext">join :: f -&gt; f -&gt; f
</span><a href="#local-6989586621681045358"><span class="hs-identifier hs-var hs-var">join</span></a></span></span><span> </span><span id="local-6989586621681045356"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045356"><span class="hs-identifier hs-var">new</span></a></span></span><span> </span><span id="local-6989586621681045355"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045355"><span class="hs-identifier hs-var">old</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">JoinedFact f -&gt; f
forall a. JoinedFact a -&gt; a
</span><a href="GHC.Cmm.Dataflow.html#getJoined"><span class="hs-identifier hs-var">getJoined</span></a></span><span> </span><span class="annot"><span class="annottext">(JoinedFact f -&gt; f) -&gt; JoinedFact f -&gt; f
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice f -&gt; JoinFun f
forall a. DataflowLattice a -&gt; JoinFun a
</span><a href="GHC.Cmm.Dataflow.html#fact_join"><span class="hs-identifier hs-var hs-var">fact_join</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045361"><span class="hs-identifier hs-var">lattice</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f -&gt; OldFact f
forall a. a -&gt; OldFact a
</span><a href="GHC.Cmm.Dataflow.html#OldFact"><span class="hs-identifier hs-var">OldFact</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045355"><span class="hs-identifier hs-var">old</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f -&gt; NewFact f
forall a. a -&gt; NewFact a
</span><a href="GHC.Cmm.Dataflow.html#NewFact"><span class="hs-identifier hs-var">NewFact</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045356"><span class="hs-identifier hs-var">new</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-372"></span><span>    </span><span id="local-6989586621681045357"><span class="annot"><span class="annottext">facts :: [f]
</span><a href="#local-6989586621681045357"><span class="hs-identifier hs-var hs-var">facts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-373"></span><span>        </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Maybe f -&gt; f
forall a. HasCallStack =&gt; Maybe a -&gt; a
</span><a href="../../base/src/Data.Maybe.html#fromJust"><span class="hs-identifier hs-var">fromJust</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe f
</span><a href="#local-6989586621681045353"><span class="hs-identifier hs-var">fact</span></a></span><span>
</span><span id="line-374"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681045352"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045352"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">n e C -&gt; [Label]
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
NonLocal thing =&gt;
thing e C -&gt; [Label]
</span><a href="GHC.Cmm.Dataflow.Graph.html#successors"><span class="hs-identifier hs-var">successors</span></a></span><span> </span><span class="annot"><span class="annottext">n e C
</span><a href="#local-6989586621681045360"><span class="hs-identifier hs-var">nonLocal</span></a></span><span>
</span><span id="line-375"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681045353"><span class="annot"><span class="annottext">fact :: Maybe f
</span><a href="#local-6989586621681045353"><span class="hs-identifier hs-var hs-var">fact</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; FactBase f -&gt; Maybe f
forall f. Label -&gt; FactBase f -&gt; Maybe f
</span><a href="GHC.Cmm.Dataflow.Label.html#lookupFact"><span class="hs-identifier hs-var">lookupFact</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045352"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">FactBase f
</span><a href="#local-6989586621681045359"><span class="hs-identifier hs-var">fact_base</span></a></span><span>
</span><span id="line-376"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe f -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe f
</span><a href="#local-6989586621681045353"><span class="hs-identifier hs-var">fact</span></a></span><span>
</span><span id="line-377"></span><span>        </span><span class="hs-special">]</span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span id="local-6989586621681045629"><span class="annot"><a href="GHC.Cmm.Dataflow.html#joinFacts"><span class="hs-identifier hs-type">joinFacts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-type">DataflowLattice</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045629"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621681045629"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045629"><span class="hs-identifier hs-type">f</span></a></span></span><span>
</span><span id="line-380"></span><span id="joinFacts"><span class="annot"><span class="annottext">joinFacts :: forall f. DataflowLattice f -&gt; [f] -&gt; f
</span><a href="GHC.Cmm.Dataflow.html#joinFacts"><span class="hs-identifier hs-var hs-var">joinFacts</span></a></span></span><span> </span><span id="local-6989586621681045349"><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045349"><span class="hs-identifier hs-var">lattice</span></a></span></span><span> </span><span id="local-6989586621681045348"><span class="annot"><span class="annottext">[f]
</span><a href="#local-6989586621681045348"><span class="hs-identifier hs-var">facts</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(f -&gt; f -&gt; f) -&gt; f -&gt; [f] -&gt; f
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">f -&gt; f -&gt; f
</span><a href="#local-6989586621681045347"><span class="hs-identifier hs-var">join</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataflowLattice f -&gt; f
forall a. DataflowLattice a -&gt; a
</span><a href="GHC.Cmm.Dataflow.html#fact_bot"><span class="hs-identifier hs-var hs-var">fact_bot</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045349"><span class="hs-identifier hs-var">lattice</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[f]
</span><a href="#local-6989586621681045348"><span class="hs-identifier hs-var">facts</span></a></span><span>
</span><span id="line-381"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-382"></span><span>    </span><span id="local-6989586621681045347"><span class="annot"><span class="annottext">join :: f -&gt; f -&gt; f
</span><a href="#local-6989586621681045347"><span class="hs-identifier hs-var hs-var">join</span></a></span></span><span> </span><span id="local-6989586621681045346"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045346"><span class="hs-identifier hs-var">new</span></a></span></span><span> </span><span id="local-6989586621681045345"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045345"><span class="hs-identifier hs-var">old</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">JoinedFact f -&gt; f
forall a. JoinedFact a -&gt; a
</span><a href="GHC.Cmm.Dataflow.html#getJoined"><span class="hs-identifier hs-var">getJoined</span></a></span><span> </span><span class="annot"><span class="annottext">(JoinedFact f -&gt; f) -&gt; JoinedFact f -&gt; f
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice f -&gt; JoinFun f
forall a. DataflowLattice a -&gt; JoinFun a
</span><a href="GHC.Cmm.Dataflow.html#fact_join"><span class="hs-identifier hs-var hs-var">fact_join</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045349"><span class="hs-identifier hs-var">lattice</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f -&gt; OldFact f
forall a. a -&gt; OldFact a
</span><a href="GHC.Cmm.Dataflow.html#OldFact"><span class="hs-identifier hs-var">OldFact</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045345"><span class="hs-identifier hs-var">old</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f -&gt; NewFact f
forall a. a -&gt; NewFact a
</span><a href="GHC.Cmm.Dataflow.html#NewFact"><span class="hs-identifier hs-var">NewFact</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045346"><span class="hs-identifier hs-var">new</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-383"></span><span>
</span><span id="line-384"></span><span class="hs-comment">-- | Returns the joined facts for each label.</span><span>
</span><span id="line-385"></span><span id="local-6989586621681045627"><span class="annot"><a href="GHC.Cmm.Dataflow.html#mkFactBase"><span class="hs-identifier hs-type">mkFactBase</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-type">DataflowLattice</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045627"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681045627"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#FactBase"><span class="hs-identifier hs-type">FactBase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045627"><span class="hs-identifier hs-type">f</span></a></span></span><span>
</span><span id="line-386"></span><span id="mkFactBase"><span class="annot"><span class="annottext">mkFactBase :: forall f. DataflowLattice f -&gt; [(Label, f)] -&gt; FactBase f
</span><a href="GHC.Cmm.Dataflow.html#mkFactBase"><span class="hs-identifier hs-var hs-var">mkFactBase</span></a></span></span><span> </span><span id="local-6989586621681045340"><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045340"><span class="hs-identifier hs-var">lattice</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LabelMap f -&gt; (Label, f) -&gt; LabelMap f)
-&gt; LabelMap f -&gt; [(Label, f)] -&gt; LabelMap f
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap f -&gt; (Label, f) -&gt; LabelMap f
</span><a href="#local-6989586621681045339"><span class="hs-identifier hs-var">add</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap f
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span>
</span><span id="line-387"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-388"></span><span>    </span><span id="local-6989586621681045338"><span class="annot"><span class="annottext">join :: JoinFun f
</span><a href="#local-6989586621681045338"><span class="hs-identifier hs-var hs-var">join</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DataflowLattice f -&gt; JoinFun f
forall a. DataflowLattice a -&gt; JoinFun a
</span><a href="GHC.Cmm.Dataflow.html#fact_join"><span class="hs-identifier hs-var hs-var">fact_join</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice f
</span><a href="#local-6989586621681045340"><span class="hs-identifier hs-var">lattice</span></a></span><span>
</span><span id="line-389"></span><span>
</span><span id="line-390"></span><span>    </span><span id="local-6989586621681045339"><span class="annot"><span class="annottext">add :: LabelMap f -&gt; (Label, f) -&gt; LabelMap f
</span><a href="#local-6989586621681045339"><span class="hs-identifier hs-var hs-var">add</span></a></span></span><span> </span><span id="local-6989586621681045337"><span class="annot"><span class="annottext">LabelMap f
</span><a href="#local-6989586621681045337"><span class="hs-identifier hs-var">result</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681045336"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681045336"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681045335"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045335"><span class="hs-identifier hs-var">f1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-391"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045334"><span class="annot"><span class="annottext">newFact :: f
</span><a href="#local-6989586621681045334"><span class="hs-identifier hs-var hs-var">newFact</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-392"></span><span>                </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap f -&gt; Maybe f
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681045336"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap f
</span><a href="#local-6989586621681045337"><span class="hs-identifier hs-var">result</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-393"></span><span>                    </span><span class="annot"><span class="annottext">Maybe f
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045335"><span class="hs-identifier hs-var">f1</span></a></span><span>
</span><span id="line-394"></span><span>                    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681045332"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045332"><span class="hs-identifier hs-var">f2</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">JoinedFact f -&gt; f
forall a. JoinedFact a -&gt; a
</span><a href="GHC.Cmm.Dataflow.html#getJoined"><span class="hs-identifier hs-var">getJoined</span></a></span><span> </span><span class="annot"><span class="annottext">(JoinedFact f -&gt; f) -&gt; JoinedFact f -&gt; f
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">JoinFun f
</span><a href="#local-6989586621681045338"><span class="hs-identifier hs-var">join</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f -&gt; OldFact f
forall a. a -&gt; OldFact a
</span><a href="GHC.Cmm.Dataflow.html#OldFact"><span class="hs-identifier hs-var">OldFact</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045335"><span class="hs-identifier hs-var">f1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f -&gt; NewFact f
forall a. a -&gt; NewFact a
</span><a href="GHC.Cmm.Dataflow.html#NewFact"><span class="hs-identifier hs-var">NewFact</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045332"><span class="hs-identifier hs-var">f2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-395"></span><span>        </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; f -&gt; LabelMap f -&gt; LabelMap f
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681045336"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045334"><span class="hs-identifier hs-var">newFact</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap f
</span><a href="#local-6989586621681045337"><span class="hs-identifier hs-var">result</span></a></span><span>
</span><span id="line-396"></span><span>
</span><span id="line-397"></span><span class="hs-comment">-- | Folds backward over all nodes of an open-open block.</span><span>
</span><span id="line-398"></span><span class="hs-comment">-- Strict in the accumulator.</span><span>
</span><span id="line-399"></span><span id="local-6989586621681045624"><span class="annot"><a href="GHC.Cmm.Dataflow.html#foldNodesBwdOO"><span class="hs-identifier hs-type">foldNodesBwdOO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045624"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045624"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045624"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045624"><span class="hs-identifier hs-type">f</span></a></span></span><span>
</span><span id="line-400"></span><span id="foldNodesBwdOO"><span class="annot"><span class="annottext">foldNodesBwdOO :: forall f. (CmmNode O O -&gt; f -&gt; f) -&gt; Block CmmNode O O -&gt; f -&gt; f
</span><a href="GHC.Cmm.Dataflow.html#foldNodesBwdOO"><span class="hs-identifier hs-var hs-var">foldNodesBwdOO</span></a></span></span><span> </span><span id="local-6989586621681045331"><span class="annot"><span class="annottext">CmmNode O O -&gt; f -&gt; f
</span><a href="#local-6989586621681045331"><span class="hs-identifier hs-var">funOO</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; f -&gt; f
</span><a href="#local-6989586621681045330"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-401"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-402"></span><span>    </span><span id="local-6989586621681045330"><span class="annot"><span class="annottext">go :: Block CmmNode O O -&gt; f -&gt; f
</span><a href="#local-6989586621681045330"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#BCat"><span class="hs-identifier hs-type">BCat</span></a></span><span> </span><span id="local-6989586621681045326"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045326"><span class="hs-identifier hs-var">b1</span></a></span></span><span> </span><span id="local-6989586621681045325"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045325"><span class="hs-identifier hs-var">b2</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681045324"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045324"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; f -&gt; f
</span><a href="#local-6989586621681045330"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045326"><span class="hs-identifier hs-var">b1</span></a></span><span> </span><span class="annot"><span class="annottext">(f -&gt; f) -&gt; f -&gt; f
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; f -&gt; f
</span><a href="#local-6989586621681045330"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045325"><span class="hs-identifier hs-var">b2</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045324"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-403"></span><span>    </span><span class="annot"><a href="#local-6989586621681045330"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#BSnoc"><span class="hs-identifier hs-type">BSnoc</span></a></span><span> </span><span id="local-6989586621681045319"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045319"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span id="local-6989586621681045318"><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681045318"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681045317"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045317"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; f -&gt; f
</span><a href="#local-6989586621681045330"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045319"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">(f -&gt; f) -&gt; f -&gt; f
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; f -&gt; f
</span><a href="#local-6989586621681045331"><span class="hs-identifier hs-var">funOO</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681045318"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045317"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-404"></span><span>    </span><span class="annot"><a href="#local-6989586621681045330"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#BCons"><span class="hs-identifier hs-type">BCons</span></a></span><span> </span><span id="local-6989586621681045313"><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681045313"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681045312"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045312"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681045311"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045311"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; f -&gt; f
</span><a href="#local-6989586621681045331"><span class="hs-identifier hs-var">funOO</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681045313"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">(f -&gt; f) -&gt; f -&gt; f
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; f -&gt; f
</span><a href="#local-6989586621681045330"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045312"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045311"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-405"></span><span>    </span><span class="annot"><a href="#local-6989586621681045330"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#BMiddle"><span class="hs-identifier hs-type">BMiddle</span></a></span><span> </span><span id="local-6989586621681045307"><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681045307"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681045306"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045306"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; f -&gt; f
</span><a href="#local-6989586621681045331"><span class="hs-identifier hs-var">funOO</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681045307"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045306"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-406"></span><span>    </span><span class="annot"><a href="#local-6989586621681045330"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="GHC.Cmm.Dataflow.Block.html#BNil"><span class="hs-identifier hs-var">BNil</span></a></span><span> </span><span id="local-6989586621681045302"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045302"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045302"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-407"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#foldNodesBwdOO"><span class="hs-pragma hs-type">foldNodesBwdOO</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-408"></span><span>
</span><span id="line-409"></span><span class="hs-comment">-- | Folds backward over all the nodes of an open-open block and allows</span><span>
</span><span id="line-410"></span><span class="hs-comment">-- rewriting them. The accumulator is both the block of nodes and @f@ (usually</span><span>
</span><span id="line-411"></span><span class="hs-comment">-- dataflow facts).</span><span>
</span><span id="line-412"></span><span class="hs-comment">-- Strict in both accumulated parts.</span><span>
</span><span id="line-413"></span><span class="annot"><a href="GHC.Cmm.Dataflow.html#foldRewriteNodesBwdOO"><span class="hs-identifier hs-type">foldRewriteNodesBwdOO</span></a></span><span>
</span><span id="line-414"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621681045622"><span class="annot"><a href="#local-6989586621681045622"><span class="hs-identifier hs-type">f</span></a></span></span><span class="hs-operator">.</span><span>
</span><span id="line-415"></span><span>       </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045622"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681045622"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-416"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span>
</span><span id="line-417"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681045622"><span class="hs-identifier hs-type">f</span></a></span><span>
</span><span id="line-418"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681045622"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-419"></span><span id="foldRewriteNodesBwdOO"><span class="annot"><span class="annottext">foldRewriteNodesBwdOO :: forall f.
(CmmNode O O -&gt; f -&gt; UniqSM (Block CmmNode O O, f))
-&gt; Block CmmNode O O -&gt; f -&gt; UniqSM (Block CmmNode O O, f)
</span><a href="GHC.Cmm.Dataflow.html#foldRewriteNodesBwdOO"><span class="hs-identifier hs-var hs-var">foldRewriteNodesBwdOO</span></a></span></span><span> </span><span id="local-6989586621681045301"><span class="annot"><span class="annottext">CmmNode O O -&gt; f -&gt; UniqSM (Block CmmNode O O, f)
</span><a href="#local-6989586621681045301"><span class="hs-identifier hs-var">rewriteOO</span></a></span></span><span> </span><span id="local-6989586621681045300"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045300"><span class="hs-identifier hs-var">initBlock</span></a></span></span><span> </span><span id="local-6989586621681045299"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045299"><span class="hs-identifier hs-var">initFacts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; f -&gt; UniqSM (Block CmmNode O O, f)
</span><a href="#local-6989586621681045298"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045300"><span class="hs-identifier hs-var">initBlock</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045299"><span class="hs-identifier hs-var">initFacts</span></a></span><span>
</span><span id="line-420"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-421"></span><span>    </span><span id="local-6989586621681045298"><span class="annot"><span class="annottext">go :: Block CmmNode O O -&gt; f -&gt; UniqSM (Block CmmNode O O, f)
</span><a href="#local-6989586621681045298"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#BCons"><span class="hs-identifier hs-type">BCons</span></a></span><span> </span><span id="local-6989586621681045294"><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681045294"><span class="hs-identifier hs-var">node1</span></a></span></span><span> </span><span id="local-6989586621681045293"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045293"><span class="hs-identifier hs-var">block1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045292"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045292"><span class="hs-identifier hs-var">fact1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode O O -&gt; f -&gt; UniqSM (Block CmmNode O O, f)
</span><a href="#local-6989586621681045301"><span class="hs-identifier hs-var">rewriteOO</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681045294"><span class="hs-identifier hs-var">node1</span></a></span><span> </span><span class="annot"><span class="annottext">(f -&gt; UniqSM (Block CmmNode O O, f))
-&gt; (f -&gt; UniqSM (Block CmmNode O O, f))
-&gt; f
-&gt; UniqSM (Block CmmNode O O, f)
forall {m :: * -&gt; *} {t} {n :: Extensibility -&gt; Extensibility -&gt; *}
       {b} {t}.
Monad m =&gt;
(t -&gt; m (Block n O O, b))
-&gt; (t -&gt; m (Block n O O, t)) -&gt; t -&gt; m (Block n O O, b)
</span><a href="#local-6989586621681045291"><span class="hs-operator hs-var">`comp`</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; f -&gt; UniqSM (Block CmmNode O O, f)
</span><a href="#local-6989586621681045298"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045293"><span class="hs-identifier hs-var">block1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045292"><span class="hs-identifier hs-var">fact1</span></a></span><span>
</span><span id="line-422"></span><span>    </span><span class="annot"><a href="#local-6989586621681045298"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#BSnoc"><span class="hs-identifier hs-type">BSnoc</span></a></span><span> </span><span id="local-6989586621681045287"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045287"><span class="hs-identifier hs-var">block1</span></a></span></span><span> </span><span id="local-6989586621681045286"><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681045286"><span class="hs-identifier hs-var">node1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045285"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045285"><span class="hs-identifier hs-var">fact1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; f -&gt; UniqSM (Block CmmNode O O, f)
</span><a href="#local-6989586621681045298"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045287"><span class="hs-identifier hs-var">block1</span></a></span><span> </span><span class="annot"><span class="annottext">(f -&gt; UniqSM (Block CmmNode O O, f))
-&gt; (f -&gt; UniqSM (Block CmmNode O O, f))
-&gt; f
-&gt; UniqSM (Block CmmNode O O, f)
forall {m :: * -&gt; *} {t} {n :: Extensibility -&gt; Extensibility -&gt; *}
       {b} {t}.
Monad m =&gt;
(t -&gt; m (Block n O O, b))
-&gt; (t -&gt; m (Block n O O, t)) -&gt; t -&gt; m (Block n O O, b)
</span><a href="#local-6989586621681045291"><span class="hs-operator hs-var">`comp`</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; f -&gt; UniqSM (Block CmmNode O O, f)
</span><a href="#local-6989586621681045301"><span class="hs-identifier hs-var">rewriteOO</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681045286"><span class="hs-identifier hs-var">node1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045285"><span class="hs-identifier hs-var">fact1</span></a></span><span>
</span><span id="line-423"></span><span>    </span><span class="annot"><a href="#local-6989586621681045298"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#BCat"><span class="hs-identifier hs-type">BCat</span></a></span><span> </span><span id="local-6989586621681045281"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045281"><span class="hs-identifier hs-var">blockA1</span></a></span></span><span> </span><span id="local-6989586621681045280"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045280"><span class="hs-identifier hs-var">blockB1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045279"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045279"><span class="hs-identifier hs-var">fact1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; f -&gt; UniqSM (Block CmmNode O O, f)
</span><a href="#local-6989586621681045298"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045281"><span class="hs-identifier hs-var">blockA1</span></a></span><span> </span><span class="annot"><span class="annottext">(f -&gt; UniqSM (Block CmmNode O O, f))
-&gt; (f -&gt; UniqSM (Block CmmNode O O, f))
-&gt; f
-&gt; UniqSM (Block CmmNode O O, f)
forall {m :: * -&gt; *} {t} {n :: Extensibility -&gt; Extensibility -&gt; *}
       {b} {t}.
Monad m =&gt;
(t -&gt; m (Block n O O, b))
-&gt; (t -&gt; m (Block n O O, t)) -&gt; t -&gt; m (Block n O O, b)
</span><a href="#local-6989586621681045291"><span class="hs-operator hs-var">`comp`</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; f -&gt; UniqSM (Block CmmNode O O, f)
</span><a href="#local-6989586621681045298"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681045280"><span class="hs-identifier hs-var">blockB1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045279"><span class="hs-identifier hs-var">fact1</span></a></span><span>
</span><span id="line-424"></span><span>    </span><span class="annot"><a href="#local-6989586621681045298"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#BMiddle"><span class="hs-identifier hs-type">BMiddle</span></a></span><span> </span><span id="local-6989586621681045276"><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681045276"><span class="hs-identifier hs-var">node</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045275"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045275"><span class="hs-identifier hs-var">fact1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; f -&gt; UniqSM (Block CmmNode O O, f)
</span><a href="#local-6989586621681045301"><span class="hs-identifier hs-var">rewriteOO</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O
</span><a href="#local-6989586621681045276"><span class="hs-identifier hs-var">node</span></a></span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045275"><span class="hs-identifier hs-var">fact1</span></a></span><span>
</span><span id="line-425"></span><span>    </span><span class="annot"><a href="#local-6989586621681045298"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="GHC.Cmm.Dataflow.Block.html#BNil"><span class="hs-identifier hs-var">BNil</span></a></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045271"><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045271"><span class="hs-identifier hs-var">fact</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Block CmmNode O O, f) -&gt; UniqSM (Block CmmNode O O, f)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Block CmmNode O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *). Block n O O
</span><a href="GHC.Cmm.Dataflow.Block.html#BNil"><span class="hs-identifier hs-var">BNil</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">f
</span><a href="#local-6989586621681045271"><span class="hs-identifier hs-var">fact</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-426"></span><span>
</span><span id="line-427"></span><span>    </span><span id="local-6989586621681045291"><span class="annot"><span class="annottext">comp :: (t -&gt; m (Block n O O, b))
-&gt; (t -&gt; m (Block n O O, t)) -&gt; t -&gt; m (Block n O O, b)
</span><a href="#local-6989586621681045291"><span class="hs-identifier hs-var hs-var">comp</span></a></span></span><span> </span><span id="local-6989586621681045266"><span class="annot"><span class="annottext">t -&gt; m (Block n O O, b)
</span><a href="#local-6989586621681045266"><span class="hs-identifier hs-var">rew1</span></a></span></span><span> </span><span id="local-6989586621681045265"><span class="annot"><span class="annottext">t -&gt; m (Block n O O, t)
</span><a href="#local-6989586621681045265"><span class="hs-identifier hs-var">rew2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681045264"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681045264"><span class="hs-identifier hs-var">f1</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-428"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681045263"><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045263"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681045262"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681045262"><span class="hs-identifier hs-var">f2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">t -&gt; m (Block n O O, t)
</span><a href="#local-6989586621681045265"><span class="hs-identifier hs-var">rew2</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681045264"><span class="hs-identifier hs-var">f1</span></a></span><span>
</span><span id="line-429"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681045261"><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045261"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045260"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621681045260"><span class="hs-identifier hs-var">f3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">t -&gt; m (Block n O O, b)
</span><a href="#local-6989586621681045266"><span class="hs-identifier hs-var">rew1</span></a></span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681045262"><span class="hs-identifier hs-var">f2</span></a></span><span>
</span><span id="line-430"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681045259"><span class="annot"><span class="annottext">c :: Block n O O
</span><a href="#local-6989586621681045259"><span class="hs-identifier hs-var hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block n O O -&gt; Block n O O -&gt; Block n O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
Block n O O -&gt; Block n O O -&gt; Block n O O
</span><a href="GHC.Cmm.Dataflow.html#joinBlocksOO"><span class="hs-identifier hs-var">joinBlocksOO</span></a></span><span> </span><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045261"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045263"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-431"></span><span>        </span><span class="annot"><span class="annottext">(Block n O O, b) -&gt; m (Block n O O, b)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045259"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621681045260"><span class="hs-identifier hs-var">f3</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="#local-6989586621681045291"><span class="hs-pragma hs-type">comp</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-433"></span><span class="hs-pragma">{-# INLINABLE</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#foldRewriteNodesBwdOO"><span class="hs-pragma hs-type">foldRewriteNodesBwdOO</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-434"></span><span>
</span><span id="line-435"></span><span id="local-6989586621681045614"><span class="annot"><a href="GHC.Cmm.Dataflow.html#joinBlocksOO"><span class="hs-identifier hs-type">joinBlocksOO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045614"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045614"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681045614"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span></span><span>
</span><span id="line-436"></span><span id="joinBlocksOO"><span class="annot"><span class="annottext">joinBlocksOO :: forall (n :: Extensibility -&gt; Extensibility -&gt; *).
Block n O O -&gt; Block n O O -&gt; Block n O O
</span><a href="GHC.Cmm.Dataflow.html#joinBlocksOO"><span class="hs-identifier hs-var hs-var">joinBlocksOO</span></a></span></span><span> </span><span class="annot"><span class="annottext">Block n O O
</span><a href="GHC.Cmm.Dataflow.Block.html#BNil"><span class="hs-identifier hs-var">BNil</span></a></span><span> </span><span id="local-6989586621681045255"><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045255"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045255"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-437"></span><span class="annot"><a href="GHC.Cmm.Dataflow.html#joinBlocksOO"><span class="hs-identifier hs-var">joinBlocksOO</span></a></span><span> </span><span id="local-6989586621681045254"><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045254"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="annot"><span class="annottext">Block n O O
</span><a href="GHC.Cmm.Dataflow.Block.html#BNil"><span class="hs-identifier hs-var">BNil</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045254"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-438"></span><span class="annot"><a href="GHC.Cmm.Dataflow.html#joinBlocksOO"><span class="hs-identifier hs-var">joinBlocksOO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#BMiddle"><span class="hs-identifier hs-type">BMiddle</span></a></span><span> </span><span id="local-6989586621681045249"><span class="annot"><span class="annottext">n O O
</span><a href="#local-6989586621681045249"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681045248"><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045248"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">n O O -&gt; Block n O O -&gt; Block n O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
n O O -&gt; Block n O x -&gt; Block n O x
</span><a href="GHC.Cmm.Dataflow.Block.html#blockCons"><span class="hs-identifier hs-var">blockCons</span></a></span><span> </span><span class="annot"><span class="annottext">n O O
</span><a href="#local-6989586621681045249"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045248"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-439"></span><span class="annot"><a href="GHC.Cmm.Dataflow.html#joinBlocksOO"><span class="hs-identifier hs-var">joinBlocksOO</span></a></span><span> </span><span id="local-6989586621681045246"><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045246"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#BMiddle"><span class="hs-identifier hs-type">BMiddle</span></a></span><span> </span><span id="local-6989586621681045243"><span class="annot"><span class="annottext">n O O
</span><a href="#local-6989586621681045243"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block n O O -&gt; n O O -&gt; Block n O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
Block n e O -&gt; n O O -&gt; Block n e O
</span><a href="GHC.Cmm.Dataflow.Block.html#blockSnoc"><span class="hs-identifier hs-var">blockSnoc</span></a></span><span> </span><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045246"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">n O O
</span><a href="#local-6989586621681045243"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-440"></span><span class="annot"><a href="GHC.Cmm.Dataflow.html#joinBlocksOO"><span class="hs-identifier hs-var">joinBlocksOO</span></a></span><span> </span><span id="local-6989586621681045241"><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045241"><span class="hs-identifier hs-var">b1</span></a></span></span><span> </span><span id="local-6989586621681045240"><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045240"><span class="hs-identifier hs-var">b2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block n O O -&gt; Block n O O -&gt; Block n O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
Block n O O -&gt; Block n O O -&gt; Block n O O
</span><a href="GHC.Cmm.Dataflow.Block.html#BCat"><span class="hs-identifier hs-var">BCat</span></a></span><span> </span><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045241"><span class="hs-identifier hs-var">b1</span></a></span><span> </span><span class="annot"><span class="annottext">Block n O O
</span><a href="#local-6989586621681045240"><span class="hs-identifier hs-var">b2</span></a></span><span>
</span><span id="line-441"></span><span>
</span><span id="line-442"></span><span class="hs-keyword">type</span><span> </span><span id="IntHeap"><span class="annot"><a href="GHC.Cmm.Dataflow.html#IntHeap"><span class="hs-identifier hs-var">IntHeap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../containers/src/Data.IntSet.Internal.html#IntSet"><span class="hs-identifier hs-type">IntSet</span></a></span><span>
</span><span id="line-443"></span></pre></body></html>